-
Hi I have previously asked this question on stackoverflow, but I haven't gotten an answer. .AddOpenIdConnect(OpenIdConnectDefaults.AuthenticationScheme, options =>
{
var configurationManager = new ConfigurationManager<OpenIdConnectConfiguration>("https://accounts.google.com/.well-known/openid-configuration", new OpenIdConnectConfigurationRetriever());
options.Configuration = configurationManager.GetConfigurationAsync().Result; options.TokenValidationParameters = new TokenValidationParameters
{
NameClaimType = "name",
ValidateIssuerSigningKey = true,
IssuerSigningKeys = options.Configuration.SigningKeys
}; Provider changes their keys:
With an app that is always running, is there a way to refresh the info from the .well-known when the OpenID Connect provider changes their certs? Right now I'm stuck with resetting the azure app service when it happens. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
SecurityTokenSignatureKeyNotFoundException will automatically trigger a refresh from the ConfigurationManager. Why are you forcibly resolving the keys up front from the ConfigurationManager rather than passing the configuration manager to OpenIdConnectOptions? |
Beta Was this translation helpful? Give feedback.
-
Thanks. I must have misunderstood how to use the api. Are you saying that this should sove my problem? .AddOpenIdConnect(OpenIdConnectDefaults.AuthenticationScheme, options =>
{
var configurationManager = new ConfigurationManager<OpenIdConnectConfiguration>(Configuration["Google:WellKnown"], new OpenIdConnectConfigurationRetriever());
//options.Configuration = configurationManager.GetConfigurationAsync().Result; // removed
options.ConfigurationManager = configurationManager; // added Edit: Or I can just set |
Beta Was this translation helpful? Give feedback.
SecurityTokenSignatureKeyNotFoundException will automatically trigger a refresh from the ConfigurationManager.
aspnetcore/src/Security/Authentication/OpenIdConnect/src/OpenIdConnectHandler.cs
Lines 765 to 772 in f54b590
Why are you forcibly resolving the keys up front from the ConfigurationManager rather than passing the configuration manager to OpenIdConnectOptions?
aspnetcore/src/Security/…