Last active
August 3, 2021 08:59
-
-
Save VisualBean/38f85bd92a9b1f992d319da3b4bdb523 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static async Task<OpenIdConnectConfiguration> GetAsync(string address, IDocumentRetriever retriever, CancellationToken cancel) | |
{ | |
OpenIdConnectConfiguration openIdConnectConfiguration = JsonConvert.DeserializeObject<OpenIdConnectConfiguration>(doc); | |
if (!string.IsNullOrEmpty(openIdConnectConfiguration.JwksUri)) | |
{ | |
string keys = await retriever.GetDocumentAsync(openIdConnectConfiguration.JwksUri, cancel).ConfigureAwait(false); | |
openIdConnectConfiguration.JsonWebKeySet = JsonConvert.DeserializeObject<JsonWebKeySet>(keys); | |
foreach (SecurityKey key in openIdConnectConfiguration.JsonWebKeySet.GetSigningKeys()) | |
{ | |
openIdConnectConfiguration.SigningKeys.Add(key); | |
} | |
} | |
return openIdConnectConfiguration; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment