Skip to content

Commit

Permalink
Merge pull request #284 from docknetwork/fix/fetching-issues-on-well-…
Browse files Browse the repository at this point in the history
…known-endpoints-resolution

fix: issues with openid  metadata resolution
  • Loading branch information
maycon-mello authored Sep 11, 2024
2 parents c2e5c7d + 41859ee commit 7c8b7e3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 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,11 @@ 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);
// We need to investigate why MetadataClient.retrieveAllMetadata(clientId); is not working on android
// Follow up bug ticket: https://dock-team.atlassian.net/browse/DCKM-600
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 7c8b7e3

Please sign in to comment.