Skip to content

Commit

Permalink
fix: issues with openid metadata resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
maycon-mello committed Sep 11, 2024
1 parent e662c93 commit 01274a4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/core/src/credentials/oidvc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {MetadataClient} from '@sphereon/oid4vci-client';
import jwtDecode from 'jwt-decode';
import axios from 'axios';
import {pexService} from '@docknetwork/wallet-sdk-wasm/src/services/pex';
import {WellKnownEndpoints} from '@sphereon/oid4vci-common';

export async function acquireOpenIDCredentialFromURI({
didProvider,
Expand Down Expand Up @@ -55,7 +56,9 @@ export async function getAuthURL(
const searchParams = new URL(uri).searchParams;
const params = new URLSearchParams(searchParams);
const clientId = params.get('client_id');
const metadata = await MetadataClient.retrieveAllMetadata(clientId);
const metadataURI = `${clientId}${WellKnownEndpoints.OPENID_CONFIGURATION}`;
const {data: metadata} = await axios.get(metadataURI);

const requestedAlg =
metadata?.authorizationServerMetadata
?.request_object_signing_alg_values_supported[0];
Expand Down

0 comments on commit 01274a4

Please sign in to comment.