C
C#13mo ago
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; }, }; });
4 Replies
antariksh
antariksh13mo ago
Where the oauth token has to be validated against an endpoint
are you writing an API? AddOpenIdConnect is mostly used for Server side authentication and with mainly cookie-scheme. If you are writing an API and want to verify access token received by your API, you can use app.UseJwtBearerAuthentication everytime a request is made to API, token is verified by this middleware
Bailey
Bailey13mo ago
thanks,
Accord
Accord13mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts