Skip to content

Commit

Permalink
if client secret is provided, do not pass in code challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
yunakim714 committed Sep 16, 2024
1 parent 6eb9175 commit 9b73db4
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/static/helpers/IDPLoginHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,18 @@ async function loginIDPUser(
): Promise<TokenResponse> {
const codeVerifier = createCodeVerifier();

const authResponse = await authorize(slasClient, codeVerifier, {
redirectURI: parameters.redirectURI,
hint: parameters.hint,
...(parameters.usid && {usid: parameters.usid}),
});
const privateClient = !!credentials.clientSecret;

const authResponse = await authorize(
slasClient,
codeVerifier,
{
redirectURI: parameters.redirectURI,
hint: parameters.hint,
...(parameters.usid && {usid: parameters.usid}),
},
privateClient
);

const tokenBody: TokenRequest = {
client_id: slasClient.clientConfig.parameters.clientId,
Expand Down

0 comments on commit 9b73db4

Please sign in to comment.