Open Closed

Cannot redirect to the authorization endpoint, the configuration may be missing or invalid #6948


User avatar
0
2ristpanel created
  • ABP Framework version: v8.0.5
  • UI Type: Blazor Server
  • Database System: MongoDB
  • Tiered: yes
  • **An unhandled exception occurred while processing the request. InvalidOperationException: Cannot redirect to the authorization endpoint, the configuration may be missing or invalid. Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.HandleChallengeAsyncInternal(AuthenticationProperties properties)

InvalidOperationException: Cannot redirect to the authorization endpoint, the configuration may be missing or invalid. Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.HandleChallengeAsyncInternal(AuthenticationProperties properties) Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.HandleChallengeAsync(AuthenticationProperties properties) Microsoft.AspNetCore.Authentication.AuthenticationHandler<TOptions>.ChallengeAsync(AuthenticationProperties properties) Microsoft.AspNetCore.Authentication.AuthenticationService.ChallengeAsync(HttpContext context, string scheme, AuthenticationProperties properties) Microsoft.AspNetCore.Mvc.ChallengeResult.ExecuteResultAsync(ActionContext context) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|30_0<TFilter, TFilterAsync>(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext<TFilter, TFilterAsync>(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters() Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync() Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker) Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|7_0(Endpoint endpoint, Task requestTask, ILogger logger) Volo.Abp.AspNetCore.Serilog.AbpSerilogMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext() Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) Volo.Abp.AspNetCore.Security.Claims.AbpDynamicClaimsMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext() Volo.Abp.AspNetCore.MultiTenancy.MultiTenancyMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext() Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) Volo.Abp.AspNetCore.Security.AbpSecurityHeadersMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext() Volo.Abp.AspNetCore.Tracing.AbpCorrelationIdMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext() Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+InterfaceMiddlewareBinder+<>c__DisplayClass2_0+<<CreateMiddleware>b__0>d.MoveNext() Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context) **:

  • **This is happen after changing ef core to mongo **:
  • API host is ok and can authorized with auth server
  • Blazor server return this exception after clicking on login btn

**this is my appsetting in blazor **

{ "App": { "SelfUrl": "https://localhost:30002", "DisablePII": false }, "RemoteServices": { "Default": { "BaseUrl": "https://localhost:30001/" }, "AbpAccountPublic": { "BaseUrl": "https://localhost:30000/" } }, "Redis": { "Configuration": "127.0.0.1" }, "AuthServer": { "Authority": "https://localhost:30000/", "RequireHttpsMetadata": false, "ClientId": "TouristPanel_Host_Panel", "ClientSecret": "########" }, "StringEncryption": { "DefaultPassPhrase": "sOCuCPsDgybjhvo4" } } this is export of OpenIddictApplications [{ "_id": { "$binary": { "base64": "fB6R7uQ2oiv/1zoRkgqXig==", "subType": "03" } }, "ConcurrencyStamp": "08f39c522c5d431c942bc83348433ade", "CreationTime": { "$date": "2024-03-27T15:53:42.742Z" }, "CreatorId": null, "LastModificationTime": null, "LastModifierId": null, "IsDeleted": false, "DeleterId": null, "DeletionTime": null, "ApplicationType": null, "ClientId": "TouristPanel_Landing", "ClientSecret": "AQAAAAEAACcQAAAAECz7dMTvIVOl6HDWHCRTciaWNvCWd3QHeslKCm6lNKJ5QrC6G9dF5Fo63D+HGm4ziQ==", "ClientType": "confidential", "ConsentType": "implicit", "DisplayName": "Web Public Tiered Application", "DisplayNames": null, "JsonWebKeySet": null, "Permissions": "["rst:code id_token","ept:logout","gt:authorization_code","rst:code","ept:authorization","ept:token","ept:revocation","ept:introspection","gt:implicit","rst:id_token","scp:address","scp:email","scp:phone","scp:profile","scp:roles","scp:TouristPanel"]", "PostLogoutRedirectUris": "["https://localhost:30003/signout-callback-oidc"]", "Properties": null, "RedirectUris": "["https://localhost:30003/signin-oidc"]", "Requirements": null, "Settings": null, "ClientUri": "https://localhost:30003/", "LogoUri": "/images/clients/aspnetcore.svg" }, { "_id": { "$binary": { "base64": "cT+v8U9JhVW2MzoRkgqXrw==", "subType": "03" } }, "ConcurrencyStamp": "2f6f728ebcc94df58c6723b2ef4184dc", "CreationTime": { "$date": "2024-03-27T15:53:42.770Z" }, "CreatorId": null, "LastModificationTime": null, "LastModifierId": null, "IsDeleted": false, "DeleterId": null, "DeletionTime": null, "ApplicationType": null, "ClientId": "TouristPanel_Host_Panel", "ClientSecret": "AQAAAAEAACcQAAAAEO/vL7EeVInufFqsJZq5RHZMpdY6Q+XMZ4uWarLyvm4DVCrVlgAjzz/HxFjbUb2TdQ==", "ClientType": "confidential", "ConsentType": "implicit", "DisplayName": "Blazor Server Application", "DisplayNames": null, "JsonWebKeySet": null, "Permissions": "["rst:code id_token","ept:logout","gt:authorization_code","rst:code","ept:authorization","ept:token","ept:revocation","ept:introspection","gt:implicit","rst:id_token","scp:address","scp:email","scp:phone","scp:profile","scp:roles","scp:TouristPanel"]", "PostLogoutRedirectUris": "["https://localhost:30002/signout-callback-oidc"]", "Properties": null, "RedirectUris": "["https://localhost:30002/signin-oidc"]", "Requirements": null, "Settings": null, "ClientUri": "https://localhost:30002/", "LogoUri": "/images/clients/blazor.svg" }, { "_id": { "$binary": { "base64": "HSNGB8hzfixEzjoRkgqXwQ==", "subType": "03" } }, "ConcurrencyStamp": "adaa4e444a9e498a8f1bf5a1dcd39f9d", "CreationTime": { "$date": "2024-03-27T15:53:42.785Z" }, "CreatorId": null, "LastModificationTime": null, "LastModifierId": null, "IsDeleted": false, "DeleterId": null, "DeletionTime": null, "ApplicationType": null, "ClientId": "TouristPanel_Host_Api", "ClientSecret": null, "ClientType": "public", "ConsentType": "implicit", "DisplayName": "Swagger Application", "DisplayNames": null, "JsonWebKeySet": null, "Permissions": "["ept:logout","gt:authorization_code","rst:code","ept:authorization","ept:token","ept:revocation","ept:introspection","scp:address","scp:email","scp:phone","scp:profile","scp:roles","scp:TouristPanel"]", "PostLogoutRedirectUris": null, "Properties": null, "RedirectUris": "["https://localhost:30001/swagger/oauth2-redirect.html"]", "Requirements": null, "Settings": null, "ClientUri": "https://localhost:30001", "LogoUri": "/images/clients/swagger.svg" }]


2 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can try to use 5.2.0 version of OpenIddict.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    The solution: https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/2491

    Use Microsoft.IdentityModel.Protocols.OpenIdConnect >= 7.4

Made with ❤️ on ABP v9.1.0-preview. Updated on December 12, 2024, 07:15