Skip to content

Commit

Permalink
fix: Add oauth flow to get authorization endpoint #3046
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Nov 1, 2024
1 parent 2af67a6 commit 1dbc831
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/oidc4vc/lib/src/oidc4vc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1015,6 +1015,23 @@ class OIDC4VC {
}
}
}

// If authorizationEndpoint is null, we fetch from oauth-
if (authorizationEndpoint == null) {
final authorizationServerConfigurationData = await getOpenIdConfig(
baseUrl: issuer,
isAuthorizationServer: true,
dio: dio,
secureStorage: secureStorage,
useOAuthAuthorizationServerLink: useOAuthAuthorizationServerLink,
);
final authorizationServerConfiguration = OpenIdConfiguration.fromJson(
authorizationServerConfigurationData,
);
authorizationEndpoint =
authorizationServerConfiguration.authorizationEndpoint;
}

// If authorizationEndpoint is null, we consider the issuer
// as the authorizationEndpoint

Expand Down

0 comments on commit 1dbc831

Please sign in to comment.