How to include additional parameters in the authorization URL


Hello all,

I am trying to include additional parameters in my authorization URL and then access them in my backend lambda function. Below is what I have

const clientId = 'eb417d75-cf9d-4b91-9c78-707b396d7ff7';
const redirectUri = '';
const scopes = 'core::'; /

// Additional parameters if needed
const additionalParams = {
param1: 'value1',
param2: 'value2',

// Construct the query string manually to avoid incorrect encoding
const queryParams = new URLSearchParams({
response_type: 'code',
client_id: clientId,
redirect_uri: redirectUri,
scope: scopes,

1. const d2lAuthorizationUrl =${queryParams};

2. const d2lAuthorizationUrl =${clientId}&redirect_uri=${encodeURIComponent(redirectUri)}&scope=${encodeURIComponent(scopes)}&param1=value1&param2=value2;

window.location.href = d2lAuthorizationUrl;

In both the scenarios I am able to get the authorization code but not the additional params(undefined)

const authorizationCode = event.queryStringParameters.code; const param1 = queryStringParameters.param1;
const param2 = queryStringParameters.param2;

Is it possible to send additional parameters along with my authorizationUrl ?? If yes please guide me here.