From 01274a4e516018151cfc07bf65853879a073c261 Mon Sep 17 00:00:00 2001 From: Maycon Date: Wed, 11 Sep 2024 10:22:52 -0300 Subject: [PATCH 1/2] fix: issues with openid metadata resolution --- packages/core/src/credentials/oidvc.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/core/src/credentials/oidvc.ts b/packages/core/src/credentials/oidvc.ts index 9638b104..bad030b7 100644 --- a/packages/core/src/credentials/oidvc.ts +++ b/packages/core/src/credentials/oidvc.ts @@ -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, @@ -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]; From 41859ee674628bd97be2deab5d6b910f4e431a1b Mon Sep 17 00:00:00 2001 From: Maycon Date: Wed, 11 Sep 2024 10:39:39 -0300 Subject: [PATCH 2/2] fix: issues with openid metadata resolution --- packages/core/src/credentials/oidvc.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/core/src/credentials/oidvc.ts b/packages/core/src/credentials/oidvc.ts index bad030b7..be629a1f 100644 --- a/packages/core/src/credentials/oidvc.ts +++ b/packages/core/src/credentials/oidvc.ts @@ -56,6 +56,8 @@ export async function getAuthURL( const searchParams = new URL(uri).searchParams; const params = new URLSearchParams(searchParams); const clientId = params.get('client_id'); + // 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);