<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z0000A1C5egCQCOkta Classic EngineAuthenticationAnswered2025-04-19T09:00:26.000Z2024-03-18T08:57:38.000Z2024-03-19T18:43:04.000Z

dzs06 (dzs06) asked a question.

Getting Issue in OKTA Configuration Implementation in .NETCORE

Created an Okta integration app. Implemented code in .netcore 5.0 to extract the token and authorized the token on the basis of cid and scope.

Created a custom middleware where I am reading the token, decrypting the token and validating the token but I am getting a error:

System.InvalidOperationException: No authenticationScheme was specified, and there was no DefaultChallengeScheme found. The default schemes can be set using either AddAuthentication(string defaultScheme) or AddAuthentication(Action<AuthenticationOptions> configureOptions).

  at Microsoft.AspNetCore.Authentication.AuthenticationService.ChallengeAsync(HttpContext context, String scheme, AuthenticationProperties properties)

  at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)

  at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)

  at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)

  at RDS.Web.API.Middlewares.CustomAuthenticationMiddleware.InvokeAsync(HttpContext httpContext) in C:\Users\vipul.aggarwal\Source\Repos\core-backend\RDS.Web.API\Middlewares\CustomAuthenticationMiddleware.cs:line 47

  at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)

  at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)

  at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

 

Could anyone help me out with this or anyone can provide any code reference document.


This question is closed.
Loading
Getting Issue in OKTA Configuration Implementation in .NETCORE