@@ -5,6 +5,7 @@ const SESSION_TTL_MS = 15 * 60_000
55const QR_SIZE = 280
66const EUDI_PID_VCTS = [ 'urn:eudi:pid:1' ]
77const LAB_AGE_VCTS = [ 'https://example.org/vct/age-credential' ]
8+ const PREREGISTERED_CLIENT_ID_SCHEME = 'pre-registered'
89
910export type WalletVerifierProfile = {
1011 baseUrl : string
@@ -55,6 +56,7 @@ export type WalletDirectPostBody = {
5556
5657export type WalletRequestObject = {
5758 client_id : string
59+ client_id_scheme : 'pre-registered'
5860 response_uri : string
5961 response_type : 'vp_token'
6062 response_mode : 'direct_post'
@@ -117,12 +119,13 @@ export function createWalletSession(baseUrl: string, now = Date.now()): WalletRp
117119}
118120
119121export function buildWalletDeepLink ( clientId : string , requestUri : string ) {
120- return `eudi-openid4vp://${ clientId } ?client_id=${ encodeURIComponent ( clientId ) } &request_uri=${ encodeURIComponent ( requestUri ) } `
122+ return `eudi-openid4vp://${ clientId } ?client_id=${ encodeURIComponent ( clientId ) } &client_id_scheme= ${ encodeURIComponent ( PREREGISTERED_CLIENT_ID_SCHEME ) } & request_uri=${ encodeURIComponent ( requestUri ) } `
121123}
122124
123125export function buildWalletRequestObject ( session : WalletRpSession , walletNonce ?: string ) : WalletRequestObject & { wallet_nonce ?: string } {
124126 return {
125127 client_id : session . clientId ,
128+ client_id_scheme : PREREGISTERED_CLIENT_ID_SCHEME ,
126129 response_uri : session . responseUri ,
127130 response_type : 'vp_token' ,
128131 response_mode : 'direct_post' ,
0 commit comments