File tree Expand file tree Collapse file tree 1 file changed +12
-15
lines changed
src/WalletFramework.Oid4Vc/Oid4Vci/Implementations Expand file tree Collapse file tree 1 file changed +12
-15
lines changed Original file line number Diff line number Diff line change @@ -406,21 +406,8 @@ private async Task<AuthorizationServerMetadata> FetchAuthorizationServerMetadata
406
406
Uri credentialIssuer = issuerMetadata . CredentialIssuer ;
407
407
408
408
var authServerUrl = issuerMetadata . AuthorizationServers . Match (
409
- servers =>
410
- {
411
- Uri first = servers . First ( ) ;
412
- return first ;
413
- } ,
414
- ( ) =>
415
- {
416
- string result ;
417
- if ( string . IsNullOrWhiteSpace ( credentialIssuer . AbsolutePath ) || credentialIssuer . AbsolutePath == "/" )
418
- result = $ "{ credentialIssuer . GetLeftPart ( UriPartial . Authority ) } /.well-known/oauth-authorization-server";
419
- else
420
- result = $ "{ credentialIssuer . GetLeftPart ( UriPartial . Authority ) } /.well-known/oauth-authorization-server" + credentialIssuer . AbsolutePath . TrimEnd ( '/' ) ;
421
-
422
- return new Uri ( result ) ;
423
- } ) ;
409
+ servers => CreateAuthorizationServerMetadataUri ( servers . First ( ) ) ,
410
+ ( ) => CreateAuthorizationServerMetadataUri ( credentialIssuer ) ) ;
424
411
425
412
var getAuthServerResponse = await _httpClient . GetAsync ( authServerUrl ) ;
426
413
@@ -437,4 +424,14 @@ private async Task<AuthorizationServerMetadata> FetchAuthorizationServerMetadata
437
424
438
425
return authServer ;
439
426
}
427
+
428
+ private static Uri CreateAuthorizationServerMetadataUri ( Uri authorizationServerUri )
429
+ {
430
+ string result ;
431
+ if ( string . IsNullOrWhiteSpace ( authorizationServerUri . AbsolutePath ) || authorizationServerUri . AbsolutePath == "/" )
432
+ result = $ "{ authorizationServerUri . GetLeftPart ( UriPartial . Authority ) } /.well-known/oauth-authorization-server";
433
+ else
434
+ result = $ "{ authorizationServerUri . GetLeftPart ( UriPartial . Authority ) } /.well-known/oauth-authorization-server" + authorizationServerUri . AbsolutePath . TrimEnd ( '/' ) ;
435
+ return new Uri ( result ) ;
436
+ }
440
437
}
You can’t perform that action at this time.
0 commit comments