Skip to content

Commit

Permalink
fix: allow to set client_id
Browse files Browse the repository at this point in the history
  • Loading branch information
nklomp committed Jun 2, 2024
1 parent 6a79e5a commit d51bf25
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/client/lib/AuthorizationCodeClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ export const createAuthorizationRequestUrl = async ({
authorizationRequest,
credentialOffer,
credentialConfigurationSupported,
clientId,
version,
}: {
pkce: PKCEOpts;
endpointMetadata: EndpointMetadataResultV1_0_13;
authorizationRequest: AuthorizationRequestOpts;
credentialOffer?: CredentialOfferRequestWithBaseUrl;
credentialConfigurationSupported?: Record<string, CredentialConfigurationSupportedV1_0_13>;
clientId?: string,
version?: OpenId4VCIVersion;
}): Promise<string> => {
function removeDisplayAndValueTypes(obj: any): void {
Expand All @@ -60,7 +62,8 @@ export const createAuthorizationRequestUrl = async ({
}
}

const { redirectUri, clientId } = authorizationRequest;
const { redirectUri } = authorizationRequest;
const client_id = clientId ?? authorizationRequest.clientId
let { scope, authorizationDetails } = authorizationRequest;
const parMode = endpointMetadata?.credentialIssuerMetadata?.require_pushed_authorization_requests
? PARMode.REQUIRE
Expand Down Expand Up @@ -140,7 +143,7 @@ export const createAuthorizationRequestUrl = async ({
}),
authorization_details: JSON.stringify(handleAuthorizationDetails(endpointMetadata, authorizationDetails)),
...(redirectUri && { redirect_uri: redirectUri }),
...(clientId && { client_id: clientId }),
...(client_id && { client_id }),
...(credentialOffer?.issuerState && { issuer_state: credentialOffer.issuerState }),
scope,
};
Expand Down

0 comments on commit d51bf25

Please sign in to comment.