Open Closed

Login and report the redirect_uri error #10161


User avatar
0
renhaiming created

hello,

the project is angular , and abp version is .9.2.1

i have deploy the project to docker which angular and api, when i go to address http://serverip:4200 and display the login ui, when i click login and report error. the api report the details error is: [11:59:33 INF] Request starting HTTP/2 GET https://10.136.36.151:44380/connect/authorize?response_type=code&client_id=NovaLab_App&state=RjVXU25Zd0hUNHpnNF9BVC1mNUJZSlg4VVpJT3FMYWoyZmNkbW12cTRiQkhz&redirect_uri=http%3A%2F%2F10.136.36.151%3A4200&scope=openid%20offline_access%20NovaLab&code_challenge=xk1RgjUh4HfAnezEvaeFFVJu1Gsl54jzTPZ-f4svYw8&code_challenge_method=S256&nonce=RjVXU25Zd0hUNHpnNF9BVC1mNUJZSlg4VVpJT3FMYWoyZmNkbW12cTRiQkhz&culture=zh-Hans&ui-culture=zh-Hans - null null 2025-11-29T11:59:33.305661029Z [11:59:33 INF] The request URI matched a server endpoint: Authorization. 2025-11-29T11:59:33.306377908Z [11:59:33 INF] The authorization request was successfully extracted: { 2025-11-29T11:59:33.306448313Z "response_type": "code", 2025-11-29T11:59:33.306458807Z "client_id": "NovaLab_App", 2025-11-29T11:59:33.306466745Z "state": "RjVXU25Zd0hUNHpnNF9BVC1mNUJZSlg4VVpJT3FMYWoyZmNkbW12cTRiQkhz", 2025-11-29T11:59:33.306476021Z "redirect_uri": "http://10.136.36.151:4200", 2025-11-29T11:59:33.306484828Z "scope": "openid offline_access NovaLab", 2025-11-29T11:59:33.306492340Z "code_challenge": "xk1RgjUh4HfAnezEvaeFFVJu1Gsl54jzTPZ-f4svYw8", 2025-11-29T11:59:33.306499388Z "code_challenge_method": "S256", 2025-11-29T11:59:33.306507129Z "nonce": "RjVXU25Zd0hUNHpnNF9BVC1mNUJZSlg4VVpJT3FMYWoyZmNkbW12cTRiQkhz", 2025-11-29T11:59:33.306514571Z "culture": "zh-Hans", 2025-11-29T11:59:33.306521727Z "ui-culture": "zh-Hans" 2025-11-29T11:59:33.306528230Z }. 2025-11-29T11:59:33.312877786Z [11:59:33 INF] Client validation failed because 'http://10.136.36.151:4200' was not a valid redirect_uri for NovaLab_App. 2025-11-29T11:59:33.312891698Z [11:59:33 INF] The authorization request was rejected because the redirect_uri was invalid: 'http://10.136.36.151:4200'. 2025-11-29T11:59:33.315019927Z [11:59:33 INF] Request finished HTTP/2 GET https://10.136.36.151:44380/connect/authorize?response_type=code&client_id=NovaLab_App&state=RjVXU25Zd0hUNHpnNF9BVC1mNUJZSlg4VVpJT3FMYWoyZmNkbW12cTRiQkhz&redirect_uri=http%3A%2F%2F10.136.36.151%3A4200&scope=openid%20offline_access%20NovaLab&code_challenge=xk1RgjUh4HfAnezEvaeFFVJu1Gsl54jzTPZ-f4svYw8&code_challenge_method=S256&nonce=RjVXU25Zd0hUNHpnNF9BVC1mNUJZSlg4VVpJT3FMYWoyZmNkbW12cTRiQkhz&culture=zh-Hans&ui-culture=zh-Hans - 302 0 null 13.1607ms 2025-11-29T11:59:33.333296966Z [11:59:33 INF] Request starting HTTP/2 GET https://10.136.36.151:44380/Error?httpStatusCode=400 - null null 2025-11-29T11:59:33.339992506Z [11:59:33 INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Controllers.ErrorController.Index (Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared)' 2025-11-29T11:59:33.340323731Z [11:59:33 INF] Route matched with {action = "Index", controller = "Error", area = "", page = ""}. Executing controller action with signature System.Threading.Tasks.Task1[Microsoft.AspNetCore.Mvc.IActionResult] Index(Int32) on controller Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Controllers.ErrorController (Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared). 2025-11-29T11:59:33.342972129Z [11:59:33 INF] Executing ViewResult, running view ~/Views/Error/Default.cshtml. 2025-11-29T11:59:33.362635898Z [11:59:33 INF] Executed ViewResult - view ~/Views/Error/Default.cshtml executed in 19.8547ms. 2025-11-29T11:59:33.362737890Z [11:59:33 INF] Executed action Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Controllers.ErrorController.Index (Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared) in 22.3684ms 2025-11-29T11:59:33.362824075Z [11:59:33 INF] Executed endpoint 'Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Controllers.ErrorController.Index (Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared)' 2025-11-29T11:59:33.363945958Z [11:59:33 INF] Request finished HTTP/2 GET https://10.136.36.151:44380/Error?httpStatusCode=400 - 400 null text/html; charset=utf-8 30.5744ms 2025-11-29T11:59:33.382540072Z [11:59:33 INF] Request starting HTTP/2 GET https://10.136.36.151:44380/Themes/LeptonX/Global/side-menu/css/bootstrap-light.css - null null 2025-11-29T11:59:33.382599063Z [11:59:33 INF] Request starting HTTP/2 GET https://10.136.36.151:44380/Themes/LeptonX/Global/side-menu/css/light.css - null null 2025-11-29T11:59:33.383027868Z [11:59:33 INF] Request starting HTTP/2 GET https://10.136.36.151:44380/__bundles/Views.Error.DefaultErrorComponent.default.F15FCDEA56EC024E1CDCD86CA6B586D8.css?_v=639000143214000924 - null null 2025-11-29T11:59:33.383053082Z [11:59:33 INF] Request starting HTTP/2 GET https://10.136.36.151:44380/__bundles/LeptonX.Global.CB0A1C447568985CB74B4BBF34865669.css?_v=639000143217578587 - null null 2025-11-29T11:59:33.383731124Z [11:59:33 INF] Sending file. Request path: '/__bundles/Views.Error.DefaultErrorComponent.default.F15FCDEA56EC024E1CDCD86CA6B586D8.css'. Physical path: 'N/A' 2025-11-29T11:59:33.383744095Z [11:59:33 INF] Sending file. Request path: '/Themes/LeptonX/Global/side-menu/css/light.css'. Physical path: 'N/A' 2025-11-29T11:59:33.383806425Z [11:59:33 INF] Request finished HTTP/2 GET https://10.136.36.151:44380/__bundles/Views.Error.DefaultErrorComponent.default.F15FCDEA56EC024E1CDCD86CA6B586D8.css?_v=639000143214000924 - 200 168 text/css 0.8358ms 2025-11-29T11:59:33.383906474Z [11:59:33 INF] Request finished HTTP/2 GET https://10.136.36.151:44380/Themes/LeptonX/Global/side-menu/css/light.css - 200 5238 text/css 1.332ms 2025-11-29T11:59:33.386257134Z [11:59:33 INF] Sending file. Request path: '/Themes/LeptonX/Global/side-menu/css/bootstrap-light.css'. Physical path: 'N/A' 2025-11-29T11:59:33.386517741Z [11:59:33 INF] Request starting HTTP/2 GET https://10.136.36.151:44380/libs/jquery-validation/localization/messages_zh.js?_v=638997732226611565 - null null 2025-11-29T11:59:33.386556770Z [11:59:33 INF] Request starting HTTP/2 GET https://10.136.36.151:44380/__bundles/LeptonX.Global.14DE296C99D9196452982BD5A099A9A9.js?_v=639000143223372141 - null null 2025-11-29T11:59:33.386567170Z [11:59:33 INF] Request finished HTTP/2 GET https://10.136.36.151:44380/Themes/LeptonX/Global/side-menu/css/bootstrap-light.css - 200 270080 text/css 3.9466ms 2025-11-29T11:59:33.386575311Z [11:59:33 INF] Request starting HTTP/2 GET https://10.136.36.151:44380/libs/timeago/locales/jquery.timeago.zh-CN.js?_v=638997731827151743 - null null 2025-11-29T11:59:33.386629595Z [11:59:33 INF] Request starting HTTP/2 GET https://10.136.36.151:44380/libs/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js?_v=638997731968170102 - null null 2025-11-29T11:59:33.386872463Z [11:59:33 INF] Request starting HTTP/2 GET https://10.136.36.151:44380/libs/moment/locale/zh-cn.js?_v=638997731677495200 - null null 2025-11-29T11:59:33.387044813Z [11:59:33 INF] Request starting HTTP/2 GET https://10.136.36.151:44380/Abp/ApplicationConfigurationScript - null null 2025-11-29T11:59:33.387066398Z [11:59:33 INF] Request starting HTTP/2 GET https://10.136.36.151:44380/Abp/ApplicationLocalizationScript?cultureName=zh-Hans - null null 2025-11-29T11:59:33.387420248Z [11:59:33 INF] Sending file. Request path: '/__bundles/LeptonX.Global.CB0A1C447568985CB74B4BBF34865669.css'. Physical path: 'N/A' 2025-11-29T11:59:33.387655133Z [11:59:33 INF] Request finished HTTP/2 GET https://10.136.36.151:44380/__bundles/LeptonX.Global.CB0A1C447568985CB74B4BBF34865669.css?_v=639000143217578587 - 200 361585 text/css 4.5577ms 2025-11-29T11:59:33.389114988Z [11:59:33 INF] Request starting HTTP/2 GET https://10.136.36.151:44380/Abp/ServiceProxyScript - null null 2025-11-29T11:59:33.393355748Z [11:59:33 INF] Executing endpoint 'Microsoft.AspNetCore.Routing.RouteEndpoint' 2025-11-29T11:59:33.393698474Z [11:59:33 INF] Executing endpoint 'Microsoft.AspNetCore.Routing.RouteEndpoint' 2025-11-29T11:59:33.393798736Z [11:59:33 INF] Executing endpoint 'Microsoft.AspNetCore.Routing.RouteEndpoint' 2025-11-29T11:59:33.393861755Z [11:59:33 INF] Executing endpoint 'Microsoft.AspNetCore.Routing.RouteEndpoint' 2025-11-29T11:59:33.393892313Z [11:59:33 INF] Sending file. Request path: 'libs/jquery-validation/localization/messages_zh.js'. Physical path: '/app/wwwroot/libs/jquery-validation/localization/messages_zh.js.br' 2025-11-29T11:59:33.393905493Z [11:59:33 INF] Executed endpoint 'Microsoft.AspNetCore.Routing.RouteEndpoint' 2025-11-29T11:59:33.394108238Z [11:59:33 INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationScriptController.Get (Volo.Abp.AspNetCore.Mvc)' 2025-11-29T11:59:33.394119774Z [11:59:33 INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.Localization.AbpApplicationLocalizationScriptController.GetAsync (Volo.Abp.AspNetCore.Mvc)' 2025-11-29T11:59:33.394175064Z [11:59:33 INF] Sending file. Request path: 'libs/timeago/locales/jquery.timeago.zh-CN.js'. Physical path: '/app/wwwroot/libs/timeago/locales/jquery.timeago.zh-CN.js.br' 2025-11-29T11:59:33.394217287Z [11:59:33 INF] Executed endpoint 'Microsoft.AspNetCore.Routing.RouteEndpoint' 2025-11-29T11:59:33.394234890Z [11:59:33 INF] Sending file. Request path: 'libs/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js'. Physical path: '/app/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js.br' 2025-11-29T11:59:33.394332748Z [11:59:33 INF] Executed endpoint 'Microsoft.AspNetCore.Routing.RouteEndpoint' 2025-11-29T11:59:33.394345039Z [11:59:33 INF] Route matched with {area = "Abp", action = "Get", controller = "AbpApplicationConfigurationScript", page = ""}. Executing controller action with signature System.Threading.Tasks.Task1[Microsoft.AspNetCore.Mvc.ActionResult] Get() on controller Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationScriptController (Volo.Abp.AspNetCore.Mvc). 2025-11-29T11:59:33.394355972Z [11:59:33 INF] Route matched with {area = "Abp", action = "Get", controller = "AbpApplicationLocalizationScript", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Microsoft.AspNetCore.Mvc.ActionResult] GetAsync(Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationLocalizationRequestDto) on controller Volo.Abp.AspNetCore.Mvc.Localization.AbpApplicationLocalizationScriptController (Volo.Abp.AspNetCore.Mvc). 2025-11-29T11:59:33.394375818Z [11:59:33 INF] Sending file. Request path: 'libs/moment/locale/zh-cn.js'. Physical path: '/app/wwwroot/libs/moment/locale/zh-cn.js.br' 2025-11-29T11:59:33.394419651Z [11:59:33 INF] Executed endpoint 'Microsoft.AspNetCore.Routing.RouteEndpoint' 2025-11-29T11:59:33.394508153Z [11:59:33 INF] Request finished HTTP/2 GET https://10.136.36.151:44380/libs/jquery-validation/localization/messages_zh.js?_v=638997732226611565 - 200 529 text/javascript 8.1539ms 2025-11-29T11:59:33.394843282Z [11:59:33 INF] Request finished HTTP/2 GET https://10.136.36.151:44380/libs/timeago/locales/jquery.timeago.zh-CN.js?_v=638997731827151743 - 200 305 text/javascript 8.2547ms 2025-11-29T11:59:33.394887419Z [11:59:33 INF] Request finished HTTP/2 GET https://10.136.36.151:44380/libs/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js?_v=638997731968170102 - 200 286 text/javascript 8.2158ms 2025-11-29T11:59:33.394975089Z [11:59:33 INF] Request finished HTTP/2 GET https://10.136.36.151:44380/libs/moment/locale/zh-cn.js?_v=638997731677495200 - 200 1295 text/javascript 8.256ms 2025-11-29T11:59:33.395911664Z [11:59:33 INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.ProxyScripting.AbpServiceProxyScriptController.GetAll (Volo.Abp.AspNetCore.Mvc)' 2025-11-29T11:59:33.396142016Z [11:59:33 INF] Route matched with {area = "Abp", action = "GetAll", controller = "AbpServiceProxyScript", page = ""}. Executing controller action with signature Microsoft.AspNetCore.Mvc.ActionResult GetAll(Volo.Abp.AspNetCore.Mvc.ProxyScripting.ServiceProxyGenerationModel) on controller Volo.Abp.AspNetCore.Mvc.ProxyScripting.AbpServiceProxyScriptController (Volo.Abp.AspNetCore.Mvc). 2025-11-29T11:59:33.574768984Z [11:59:33 INF] Request starting HTTP/2 GET https://10.136.36.151:44380/images/logo/leptonx/icon.svg - null null 2025-11-29T11:59:33.574800505Z [11:59:33 INF] Request starting HTTP/2 GET https://10.136.36.151:44380/Themes/LeptonX/Global/side-menu/libs/bootstrap-icons/font/fonts/bootstrap-icons.woff2?30af91bf14e37666a085fb8a161ff36d - null null 2025-11-29T11:59:33.579520013Z [11:59:33 INF] Sending file. Request path: '/Themes/LeptonX/Global/side-menu/libs/bootstrap-icons/font/fonts/bootstrap-icons.woff2'. Physical path: 'N/A' 2025-11-29T11:59:33.579618589Z [11:59:33 INF] Request finished HTTP/2 GET https://10.136.36.151:44380/Themes/LeptonX/Global/side-menu/libs/bootstrap-icons/font/fonts/bootstrap-icons.woff2?30af91bf14e37666a085fb8a161ff36d - 200 92064 font/woff2 4.8089ms 2025-11-29T11:59:33.587927770Z [11:59:33 INF] Executing ContentResult with HTTP Response ContentType of application/javascript 2025-11-29T11:59:33.589241531Z [11:59:33 INF] Executed action Volo.Abp.AspNetCore.Mvc.Localization.AbpApplicationLocalizationScriptController.GetAsync (Volo.Abp.AspNetCore.Mvc) in 194.8151ms 2025-11-29T11:59:33.589255116Z [11:59:33 INF] Executed endpoint 'Volo.Abp.AspNetCore.Mvc.Localization.AbpApplicationLocalizationScriptController.GetAsync (Volo.Abp.AspNetCore.Mvc)' 2025-11-29T11:59:33.590060303Z [11:59:33 INF] Executing endpoint 'Microsoft.AspNetCore.Routing.RouteEndpoint' 2025-11-29T11:59:33.590252749Z [11:59:33 INF] Executing ContentResult with HTTP Response ContentType of application/javascript 2025-11-29T11:59:33.590517160Z [11:59:33 INF] Executed action Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationScriptController.Get (Volo.Abp.AspNetCore.Mvc) in 196.0919ms 2025-11-29T11:59:33.590531934Z [11:59:33 INF] Sending file. Request path: 'images/logo/leptonx/icon.svg'. Physical path: '/app/wwwroot/images/logo/leptonx/icon.svg.br' 2025-11-29T11:59:33.590571178Z [11:59:33 INF] Executed endpoint 'Microsoft.AspNetCore.Routing.RouteEndpoint' 2025-11-29T11:59:33.590580884Z [11:59:33 INF] Executed endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationScriptController.Get (Volo.Abp.AspNetCore.Mvc)' 2025-11-29T11:59:33.590958463Z [11:59:33 INF] Request finished HTTP/2 GET https://10.136.36.151:44380/images/logo/leptonx/icon.svg - 200 1284 image/svg+xml 16.2337ms 2025-11-29T11:59:33.596748112Z [11:59:33 INF] Request finished HTTP/2 GET https://10.136.36.151:44380/Abp/ApplicationLocalizationScript?cultureName=zh-Hans - 200 105943 application/javascript 209.6368ms 2025-11-29T11:59:33.596798088Z [11:59:33 INF] Sending file. Request path: '/__bundles/LeptonX.Global.14DE296C99D9196452982BD5A099A9A9.js'. Physical path: 'N/A' 2025-11-29T11:59:33.596867163Z [11:59:33 INF] Request finished HTTP/2 GET https://10.136.36.151:44380/Abp/ApplicationConfigurationScript - 200 6303 application/javascript 209.8657ms 2025-11-29T11:59:33.596936595Z [11:59:33 INF] Request finished HTTP/2 GET https://10.136.36.151:44380/__bundles/LeptonX.Global.14DE296C99D9196452982BD5A099A9A9.js?_v=639000143223372141 - 200 941839 application/javascript 210.5654ms 2025-11-29T11:59:33.660993228Z [11:59:33 INF] Executing ContentResult with HTTP Response ContentType of application/javascript 2025-11-29T11:59:33.661526959Z [11:59:33 INF] Executed action Volo.Abp.AspNetCore.Mvc.ProxyScripting.AbpServiceProxyScriptController.GetAll (Volo.Abp.AspNetCore.Mvc) in 265.3227ms 2025-11-29T11:59:33.661540674Z [11:59:33 INF] Executed endpoint 'Volo.Abp.AspNetCore.Mvc.ProxyScripting.AbpServiceProxyScriptController.GetAll (Volo.Abp.AspNetCore.Mvc)' 2025-11-29T11:59:33.662960841Z [11:59:33 INF] Request finished HTTP/2 GET https://10.136.36.151:44380/Abp/ServiceProxyScript - 200 162611 application/javascript 273.8543ms


3 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    1. Solution Your AuthServer is rejecting the authorization request because the redirect_uri sent by the Angular app (http://10.136.36.151:4200) is not registered as an allowed redirect/callback URL for the client NovaLab_App.

    Do the following:

    • Add the Angular URL(s) to RedirectAllowedUrls (ABP/OpenIddict)
      • In your AuthServer (or HttpApi.Host for non-tiered Angular apps), open appsettings.json and set:
    "App": {
        "SelfUrl": "https://10.136.36.151:44380",
        "RedirectAllowedUrls": "http://localhost:4200,http://10.136.36.151:4200,https://10.136.36.151:4200"
      }
    

    Notes:

    • Include every URL the SPA can use: local dev, IP:port, domain names, and HTTPS variants (if applicable).

    • If you terminate TLS elsewhere but serve Angular over HTTPS, include the https:// variant.

    • Restart the AuthServer after changing appsettings.

    • Ensure the OpenIddict client (NovaLab_App) has the exact redirect URIs

      • If you seed clients in code (e.g., OpenIddictDataSeedContributor), ensure NovaLab_App includes:
        • RedirectUris: http://10.136.36.151:4200
        • PostLogoutRedirectUris: http://10.136.36.151:4200
        • Also include http://localhost:4200 for local dev.
      • Re-run migrator/seed or update via OpenIddict management UI if you have it.
      • Redirect URIs must match exactly (scheme, host, port, path).
    • Align Angular environment configuration

      • In angular/src/environments/environment.prod.ts (and environment.ts), verify:
        • oAuthConfig.issuer points to your AuthServer public URL (https://10.136.36.151:44380).
        • oAuthConfig.redirectUri equals the SPA origin used by the browser (e.g., http://10.136.36.151:4200).
        • oAuthConfig.postLogoutRedirectUri matches the same origin.
      • The SPA’s redirectUri must be one of the allowed RedirectUris you registered.
    • Don’t mix schemes unintentionally

      • Your log shows AuthServer at https://10.136.36.151:44380 while Angular is http://10.136.36.151:4200. This is fine as long as http://10.136.36.151:4200 is explicitly allowed.
      • If you switch Angular to HTTPS later, add the https://:4200 variant too.
    • Reverse proxy/containers tip

      • If running behind a proxy, ensure the AuthServer sees the correct external scheme/host (use ForwardedHeaders middleware). This doesn’t change redirect_uri validation but prevents other OIDC issues.

    After these changes, restart services. The login should proceed without “invalid redirect_uri”.

    1. Sources
    • OpenIddict deployment note (register RedirectAllowedUrls for Angular/Blazor):
      • https://abp.io/docs/latest/solution-templates/layered-web-application/deployment/openiddict-deployment

    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

  • User Avatar
    0
    renhaiming created

    i have fix, because the dbmigrator the database the redrect uri is mistake.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Hi

    Thanks. I have refunded your question ticket.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.1.0-preview. Updated on December 03, 2025, 13:19
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.