Ends in:
2 DAYS
5 HRS
3 MIN
17 SEC
Ends in:
2 D
5 H
3 M
17 S
Open Closed

Routing not working in IIS #2096


User avatar
0
devraj.np@gmail.com created
  • UI type: Angular / MVC / Blazor
  • DB provider: EF Core / SQL Server I have deployed my angular+dotnetcore app into IIS. You can find the public link here http://116.90.234.198:8080/ , Home, FAQ, Report a Bug are being browsed as they are angular page but if i click on login it is not being routed. However if i type the url http://116.90.234.198:8080/account/login i can browse it. My HTTP Api Module is as follows

23 Answer(s)
  • User Avatar
    0
    bunyamin created

    Hello,

    Since you are not using HTTPS yet, you need to set requireHttps to false in environment.prod.ts as follows:

    export const environment = {
      // ...
      oAuthConfig: {
        // ...
        requireHttps: false
      },
    
      // ...
    } as Config.Environment;
    
  • User Avatar
    0
    devraj.np@gmail.com created

    got this after setting require https to false

  • User Avatar
    0
    bunyamin created

    Could you share the logs of the request to see why it has failed?

  • User Avatar
    0
    devraj.np@gmail.com created

    Please find the logs in the link https://drive.google.com/file/d/1N0hRV1y2P2V4nyyJHNQl8O824wyQ5tyX/view?usp=sharing

  • User Avatar
    0
    bunyamin created

    The log states that you have not set redirect uri properly.

    Invalid redirect_uri: http://116.90.234.198:8080 {"ClientId":"BMP_App","ClientName":"BMP_App","RedirectUri":null,"AllowedRedirectUris":["http://localhost:4200"]

  • User Avatar
    0
    devraj.np@gmail.com created

    This is my enviroemnt.prod.ts file. where do i set the redirect uri ?

  • User Avatar
    0
    bunyamin created

    That's config file for angular application. You need to edit redirect uri in appsettings.json.

  • User Avatar
    0
    devraj.np@gmail.com created

    I couldnt find that key in appsettings.json. Kindly provide a doc or example of the same.

  • User Avatar
    0
    devraj.np@gmail.com created

    Can i have an update please- still my error is** An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set.**

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi @devraj.np@gmail.com, does your problem can be related with https://support.abp.io/QA/Questions/1009/Invalid-redirecturi---RedirectAllowedUrls-on-Login-page?

  • User Avatar
    0
    devraj.np@gmail.com created

    Hi , I have already done that but it's not working. Actually non of my deployement is working in IIS, i also have other mvc prroject deployed but error is same. this error was from angular +dotnetcore. Please provide me remote support to sort it out, im in a bit of trobule since has been pending for some time.

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi, did you add the url http://116.90.234.198:8080 into the RedirectAllowedUrls section of your package.json file? (in HttpApi.Host project)

    {
      "App": {
        "SelfUrl": "https://localhost:44326",
        "AngularUrl": "http://localhost:4200",
        "CorsOrigins": "https://*.MyProjectName.com,http://localhost:4200,http://116.90.234.198:8080",
        "RedirectAllowedUrls": "http://localhost:4200,https://localhost:44307,http://116.90.234.198:8080"
      },
      //...
    }
    

    Also add this url to CorsOrigins section.

  • User Avatar
    0
    devraj.np@gmail.com created

    Yes, but doesn't work. Screenshot of the Appsettings.json

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Does the error still same?

    Btw, you should specify the SelfUrl as your HttpApi.Host url not Angular project url.

  • User Avatar
    0
    devraj.np@gmail.com created

    My Angular and API are are hosted in the same node in the IIS - so do i have to keep the angular url empty ? I tried removing the key it doesn't work.

  • User Avatar
    0
    devraj.np@gmail.com created

    I used to recieve remote support previously - why is this time support is not paying attention and not trying to solve the problems. i already know these answers.

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    My Angular and API are are hosted in the same node in the IIS - so do i have to keep the angular url empty ? I tried removing the key it doesn't work.

    No, they both need to be the same then.

    Did you change your appsettings.json when migrating the database (in DbMigrator project)?

    {
      "ConnectionStrings": {
        "Default": "Server=localhost;Database=MyApp;Trusted_Connection=True"
      },
      "IdentityServer": {
        "Clients": {
          //...
          "MyProjectName_App": {
            "ClientId": "MyProjectName_App",
            "RootUrl": "http://116.90.234.198:8080" //change root url
          },
          //...
        }
      }
    }
    
  • User Avatar
    0
    devraj.np@gmail.com created

    App settings of migrator App config of the host Angular prod Config Table for the ClientRedirectURIS Any other info you need please let me know ..

  • User Avatar
    0
    devraj.np@gmail.com created

    Have been waiting on this!

  • User Avatar
    0
    bunyamin created

    Have been waiting on this!

    We have discussed your problem and it looks like this article may solve your issue.

    https://community.abp.io/articles/patch-for-chrome-login-issue-identityserver4-samesite-cookie-problem-weypwp3n

    Could you please try it out and post the results?

  • User Avatar
    0
    devraj.np@gmail.com created

    2021-11-20 12:08:28.756 +05:45 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name BMP Health Status. System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReport(HealthCheckConfiguration configuration) 2021-11-20 12:08:28.792 +05:45 [ERR] Connection ID "16645304232961901151", Request ID "80000260-0002-e700-b63f-84710c7967bb": An unhandled exception was thrown by the application. System.Threading.Tasks.TaskCanceledException: A task was canceled. at Volo.Abp.Threading.SemaphoreSlimExtensions.LockAsync(SemaphoreSlim semaphoreSlim, CancellationToken cancellationToken) at Volo.Abp.Caching.DistributedCache2.GetOrAddAsync(TCacheKey key, Func1 factory, Func1 optionsFactory, Nullable1 hideErrors, Boolean considerUow, CancellationToken token) at Volo.Abp.LanguageManagement.DatabaseLanguageProvider.GetLanguagesAsync() at Microsoft.AspNetCore.RequestLocalization.DefaultAbpRequestLocalizationOptionsProvider.GetLocalizationOptionsAsync() at Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT`1.ProcessRequestAsync() 2021-11-20 12:08:38.951 +05:45 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name BMP Health Status. System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReport(HealthCheckConfiguration configuration) 2021-11-20 12:08:48.976 +05:45 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name BMP Health Status. System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReport(HealthCheckConfiguration configuration) 2021-11-20 12:08:58.989 +05:45 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name BMP Health Status. System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReport(HealthCheckConfiguration configuration) 2021-11-20 12:09:09.002 +05:45 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name BMP Health Status. System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReport(HealthCheckConfiguration configuration) 2021-11-20 12:09:19.015 +05:45 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name BMP Health Status. System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReport(HealthCheckConfiguration configuration) 2021-11-20 12:09:29.028 +05:45 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name BMP Health Status. System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReport(HealthCheckConfiguration configuration) 2021-11-20 12:09:39.042 +05:45 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name BMP Health Status. System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReport(HealthCheckConfiguration configuration) 2021-11-20 12:09:49.071 +05:45 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name BMP Health Status. System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReport(HealthCheckConfiguration configuration) 2021-11-20 12:09:59.084 +05:45 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name BMP Health Status. System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReport(HealthCheckConfiguration configuration) 2021-11-20 12:10:09.097 +05:45 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name BMP Health Status. System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReport(HealthCheckConfiguration configuration) 2021-11-20 12:10:19.110 +05:45 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name BMP Health Status. System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReport(HealthCheckConfiguration configuration) 2021-11-20 12:10:29.124 +05:45 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name BMP Health Status. System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReport(HealthCheckConfiguration configuration)

  • User Avatar
    0
    devraj.np@gmail.com created

    Still getting the same error, i notices a weird fact. All get actions are completed, for e.g in the screenshot below i can get values in the dropdown but i cannot do a post. Maybe this would help.. the error is still same in the log.

  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Hi,

    Have tried to configure your web.config like following topic: https://stackoverflow.com/a/44473484/7200126

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