C#C
C#3y ago
4 replies
Bailey

❔ openid connect oauth2

Hello,

Does anyone have a good example of oauth2 implementation with openId.
Where the oauth token has to be validated against an endpoint

Like (found this somewhere):
.AddOpenIdConnect(OpenIdConnectDefaults.AuthenticationScheme, options =>
{
options.Authority = "https://aUTHORITY";
options.ClientId = "platformnet6";
options.ClientSecret = "123456789"; // need 1 without client secret
options.ResponseType = "code";
options.CallbackPath = "/signin-oidc";
options.SaveTokens = true;
options.TokenValidationParameters = new TokenValidationParameters
{
ValidateIssuerSigningKey = false,
SignatureValidator = delegate(string token, TokenValidationParameters validationParameters)
{
var jwt = new JwtSecurityToken(token);
return jwt;
},
};
});
Was this page helpful?