Activités de "imranStem"

This is the logs for auth server.

[13:49:38 INF] AUDIT LOG: [500: GET    ] /connect/token
- UserName - UserId                 :  -
- ClientIpAddress        : ::ffff:10.224.1.60
- ExecutionDuration      : 3
- Actions:
  - Volo.Abp.OpenIddict.Controllers.TokenController.HandleAsync (1 ms.)
    {}
- Exceptions:
  - The OpenID Connect request cannot be retrieved.
    System.InvalidOperationException: The OpenID Connect request cannot be retrieved.
   at Volo.Abp.OpenIddict.Controllers.AbpOpenIdDictControllerBase.GetOpenIddictServerRequestAsync(HttpContext httpContext)
   at Volo.Abp.OpenIddict.Controllers.TokenController.HandleAsync()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.&lt;InvokeNextActionFilterAsync&gt;g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.&lt;InvokeNextExceptionFilterAsync&gt;g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ExceptionContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeNextResourceFilter()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.&lt;InvokeAsync&gt;g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.&lt;InvokeAsync&gt;g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.&lt;Invoke&gt;g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)

[13:49:38 ERR] An unhandled exception has occurred while executing the request.
System.InvalidOperationException: The OpenID Connect request cannot be retrieved.
   at Volo.Abp.OpenIddict.Controllers.AbpOpenIdDictControllerBase.GetOpenIddictServerRequestAsync(HttpContext httpContext)
   at Volo.Abp.OpenIddict.Controllers.TokenController.HandleAsync()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.&lt;InvokeActionMethodAsync&gt;g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ExceptionContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeNextResourceFilter()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.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 Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Volo.Abp.AspNetCore.Uow.AbpUnitOfWorkMiddleware.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 Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingMiddleware.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 Volo.Abp.AspNetCore.Serilog.AbpSerilogMiddleware.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 Volo.Abp.AspNetCore.MultiTenancy.MultiTenancyMiddleware.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.Builder.ApplicationBuilderAbpOpenIddictMiddlewareExtension.<>c__DisplayClass0_0.<<UseAbpOpenIddictValidation>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Builder.ApplicationBuilderAbpJwtTokenMiddlewareExtension.<>c__DisplayClass0_0.<<UseJwtTokenMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Prometheus.HttpMetrics.HttpRequestDurationMiddleware.Invoke(HttpContext context)
   at Prometheus.HttpMetrics.HttpRequestCountMiddleware.Invoke(HttpContext context)
   at Prometheus.HttpMetrics.HttpInProgressMiddleware.Invoke(HttpContext context)
   at Volo.Abp.AspNetCore.Security.AbpSecurityHeadersMiddleware.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 Volo.Abp.AspNetCore.Tracing.AbpCorrelationIdMiddleware.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.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|8_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)
[13:49:38 INF] Identity.Application was not authenticated. Failure message: Unprotect ticket failed
[13:49:38 INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Controllers.ErrorController.Index (Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared)'
[13:49:38 INF] Route matched with {action = "Index", controller = "Error", area = "", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Microsoft.AspNetCore.Mvc.IActionResult] Index(Int32) on controller Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Controllers.ErrorController (Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared).
[13:49:38 INF] Executing ViewResult, running view ~/Views/Error/500.cshtml.
[13:49:38 INF] Executed ViewResult - view ~/Views/Error/500.cshtml executed in 2.6941ms.
[13:49:38 INF] Executed action Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Controllers.ErrorController.Index (Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared) in 3.489ms
[13:49:38 INF] Executed endpoint 'Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Controllers.ErrorController.Index (Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared)'
[13:49:38 INF] Request finished HTTP/1.1 GET http://nxp-authserver.order-line.co.uk/connect/token - - - 500 - text/html;+charset=utf-8 13.1326ms
[13:49:38 INF] Request starting HTTP/1.1 GET http://nxp-authserver.order-line.co.uk/__bundles/LeptonX.Global.9325FB768F9C0093DC4664395D730921.css?_v=638133564390389602 - -
[13:49:38 INF] The file /__bundles/LeptonX.Global.9325FB768F9C0093DC4664395D730921.css was not modified
[13:49:38 INF] Request finished HTTP/1.1 GET http://nxp-authserver.order-line.co.uk/__bundles/LeptonX.Global.9325FB768F9C0093DC4664395D730921.css?_v=638133564390389602 - - - 304 - text/css 0.3928ms
[13:49:38 INF] Request starting HTTP/1.1 GET http://nxp-authserver.order-line.co.uk/__bundles/Views.Error.DefaultErrorComponent.default.F15FCDEA56EC024E1CDCD86CA6B586D8.css?_v=638133564388112886 - -
[13:49:38 INF] Request starting HTTP/1.1 GET http://nxp-authserver.order-line.co.uk/Abp/ApplicationConfigurationScript - -
[13:49:38 INF] The file /__bundles/Views.Error.DefaultErrorComponent.default.F15FCDEA56EC024E1CDCD86CA6B586D8.css was not modified
[13:49:38 INF] Request finished HTTP/1.1 GET http://nxp-authserver.order-line.co.uk/__bundles/Views.Error.DefaultErrorComponent.default.F15FCDEA56EC024E1CDCD86CA6B586D8.css?_v=638133564388112886 - - - 304 - text/css 0.2583ms
[13:49:38 INF] Request starting HTTP/1.1 GET http://nxp-authserver.order-line.co.uk/__bundles/LeptonX.Global.DD44B0ECF605910A5B8FAD560D306DDE.js?_v=638133564395674662 - -
[13:49:38 INF] The file /__bundles/LeptonX.Global.DD44B0ECF605910A5B8FAD560D306DDE.js was not modified
[13:49:38 INF] Request finished HTTP/1.1 GET http://nxp-authserver.order-line.co.uk/__bundles/LeptonX.Global.DD44B0ECF605910A5B8FAD560D306DDE.js?_v=638133564395674662 - - - 304 - application/javascript 0.1328ms
[13:49:38 INF] Request starting HTTP/1.1 GET http://nxp-authserver.order-line.co.uk/Abp/ApplicationLocalizationScript?cultureName=en - -
[13:49:38 INF] Identity.Application was not authenticated. Failure message: Unprotect ticket failed
[13:49:38 INF] Identity.Application was not authenticated. Failure message: Unprotect ticket failed
[13:49:38 INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.Localization.AbpApplicationLocalizationScriptController.GetAsync (Volo.Abp.AspNetCore.Mvc)'
[13:49:38 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).
[13:49:38 INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationScriptController.Get (Volo.Abp.AspNetCore.Mvc)'
[13:49:38 INF] Route matched with {area = "Abp", action = "Get", controller = "AbpApplicationConfigurationScript", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Microsoft.AspNetCore.Mvc.ActionResult] Get() on controller Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationScriptController (Volo.Abp.AspNetCore.Mvc).
[13:49:38 INF] Executing ContentResult with HTTP Response ContentType of application/javascript
[13:49:38 INF] Executed action Volo.Abp.AspNetCore.Mvc.Localization.AbpApplicationLocalizationScriptController.GetAsync (Volo.Abp.AspNetCore.Mvc) in 5.6876ms
[13:49:38 INF] Executed endpoint 'Volo.Abp.AspNetCore.Mvc.Localization.AbpApplicationLocalizationScriptController.GetAsync (Volo.Abp.AspNetCore.Mvc)'
[13:49:38 INF] Request finished HTTP/1.1 GET http://nxp-authserver.order-line.co.uk/Abp/ApplicationLocalizationScript?cultureName=en - - - 200 53421 application/javascript 8.0021ms
[13:49:38 INF] Request starting HTTP/1.1 GET http://nxp-authserver.order-line.co.uk/Abp/ServiceProxyScript - -
[13:49:38 INF] Identity.Application was not authenticated. Failure message: Unprotect ticket failed
[13:49:38 INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.ProxyScripting.AbpServiceProxyScriptController.GetAll (Volo.Abp.AspNetCore.Mvc)'
[13:49:38 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).
[13:49:38 INF] Executing ContentResult with HTTP Response ContentType of application/javascript
[13:49:38 INF] Executed action Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationScriptController.Get (Volo.Abp.AspNetCore.Mvc) in 7.3815ms
[13:49:38 INF] Executed endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationScriptController.Get (Volo.Abp.AspNetCore.Mvc)'
[13:49:38 INF] Request finished HTTP/1.1 GET http://nxp-authserver.order-line.co.uk/Abp/ApplicationConfigurationScript - - - 200 5306 application/javascript 12.4091ms
[13:49:38 INF] Executing ContentResult with HTTP Response ContentType of application/javascript
[13:49:38 INF] Executed action Volo.Abp.AspNetCore.Mvc.ProxyScripting.AbpServiceProxyScriptController.GetAll (Volo.Abp.AspNetCore.Mvc) in 1.1703ms
[13:49:38 INF] Executed endpoint 'Volo.Abp.AspNetCore.Mvc.ProxyScripting.AbpServiceProxyScriptController.GetAll (Volo.Abp.AspNetCore.Mvc)'
[13:49:38 INF] Request finished HTTP/1.1 GET http://nxp-authserver.order-line.co.uk/Abp/ServiceProxyScript - - - 200 54 application/javascript 4.1264ms

Browser console log

AdministrationService logs seems fine, no error

[08:43:54 INF] Request starting HTTP/1.1 GET http://nxp-staging-administration-service-v1.nxp-staging.svc.cluster.local/api/abp/application-configuration?includeLocalizationResources=false - 0

[08:43:54 INF] CORS policy execution successful.

[08:43:54 INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc)'

[08:43:54 INF] Route matched with {area = "abp", action = "Get", controller = "AbpApplicationConfiguration", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto] GetAsync(Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationRequestOptions) on controller Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController (Volo.Abp.AspNetCore.Mvc).

[08:43:54 WRN] The cookie 'XSRF-TOKEN' has set 'SameSite=None' and must also set 'Secure'.

[08:43:54 INF] Executing ObjectResult, writing value of type 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto'.

[08:43:54 INF] Executed action Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc) in 5.7676ms

[08:43:54 INF] Executed endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc)'

[08:43:54 INF] Request finished HTTP/1.1 GET http://nxp-staging-administration-service-v1.nxp-staging.svc.cluster.local/api/abp/application-configuration?includeLocalizationResources=false - 0 - 200 - application/json;+charset=utf-8 8.5298ms

[08:43:54 INF] Request starting HTTP/1.1 GET http://nxp-staging-administration-service-v1.nxp-staging.svc.cluster.local/api/abp/application-localization?cultureName=en&onlyDynamics=false - 0

[08:43:54 INF] CORS policy execution successful.

[08:43:54 INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationLocalizationController.GetAsync (Volo.Abp.AspNetCore.Mvc)'

[08:43:54 INF] Route matched with {area = "abp", action = "Get", controller = "AbpApplicationLocalization", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationLocalizationDto] GetAsync(Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationLocalizationRequestDto) on controller Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationLocalizationController (Volo.Abp.AspNetCore.Mvc).

Auth Server Logs:

[08:48:36 INF] Request finished HTTP/1.1 GET http://nxp-authserver.order-line.co.uk/.well-known/openid-configuration - - - 200 2102 application/json;charset=UTF-8 1.0450ms

[08:48:37 INF] Request starting HTTP/1.1 OPTIONS http://nxp-authserver.order-line.co.uk/.well-known/jwks - -

[08:48:37 INF] CORS policy execution successful.

[08:48:37 INF] Request finished HTTP/1.1 OPTIONS http://nxp-authserver.order-line.co.uk/.well-known/jwks - - - 204 - - 0.3026ms

[08:48:37 INF] Request starting HTTP/1.1 GET http://nxp-authserver.order-line.co.uk/.well-known/jwks - -

[08:48:37 INF] CORS policy execution successful.

[08:48:37 INF] Request finished HTTP/1.1 GET http://nxp-authserver.order-line.co.uk/.well-known/jwks - - - 302 0 - 2.7687ms

From the browser, Its requesting to https://nxp-authserver.order-line.co.uk/.well-known/jwks but in the log, the URL of jwks is without the https. Although http://nxp-authserver.order-line.co.uk/.well-known/openid-configuration return 200 status while http://nxp-authserver.order-line.co.uk/.well-known/jwks return 204 http status.

I can successfully login in https://nxp-authserver.order-line.co.uk/ but not able to login from the angular.

I have checked the above code. Its negotiate two times with different connection id and getting response No connection with that ID.

https://github.com/abpframework/abp-samples/tree/master/ConcurrentLogin

But this sample is integrated with the identity server 4 and the microservice template has OpenID configuration.

Répondre

I am trying to integrate concurrent login in the Identity service but the problem is I have version 6.0rc.5 with OpenIdDict integration and the concurrent login sample version is 6.0rc.2 with Identity server 4 integration.

I am struggling to replace the below file to convert into OpenIdDict.

using System;
using System.Threading.Tasks;
using IdentityServer4.AspNetIdentity;
using IdentityServer4.Validation;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Identity;
using Volo.Abp.IdentityServer.AspNetIdentity;
using Volo.Abp.IdentityServer.Localization;
using IdentityUser = Volo.Abp.Identity.IdentityUser;

namespace ChurchPharmacy.IdentityService.AspNetIdentity;

public class ConcurrentLoginResourceOwnerPasswordValidator : AbpResourceOwnerPasswordValidator
{
    public ConcurrentLoginResourceOwnerPasswordValidator(
        Microsoft.AspNetCore.Identity.UserManager<IdentityUser> userManager,
        Microsoft.AspNetCore.Identity.SignInManager<IdentityUser> signInManager,
        IdentitySecurityLogManager identitySecurityLogManager,
        ILogger<ResourceOwnerPasswordValidator<IdentityUser>> logger,
        IStringLocalizer<AbpIdentityServerResource> localizer, IOptions<AbpIdentityOptions> abpIdentityOptions,
        IHybridServiceScopeFactory serviceScopeFactory, IOptions<IdentityOptions> identityOptions) : base(userManager,
        signInManager, identitySecurityLogManager, logger, localizer, abpIdentityOptions, serviceScopeFactory,
        identityOptions)
    {
    }

    protected override async Task SetSuccessResultAsync(ResourceOwnerPasswordValidationContext context, IdentityUser user)
    {
        user.SetProperty(ConcurrentLoginConsts.ConcurrentLoginToken, Guid.NewGuid().ToString("N"));
        await UserManager.UpdateAsync(user);
         await base.SetSuccessResultAsync(context, user);
    }
}

I fixed the issue. I registered a domain resolver on the gateway level. I removed from gateway and registered in administration microservice level.

I have created my custom domain tenant resolver class. I have the below configuration in a microservice architecture. I am using the 6.0 preview version.

Angular Host Domain: abp.mydomain.com Gateway domain: abpapi.mydomain.com AuthServer domain: abpauth.mydomain.com

Tenant domain: tenant.mydomain.com The gateway and auth server are the same as above.

 Configure<AbpTenantResolveOptions>(options =>
        {
            options.TenantResolvers.Clear();
            options.TenantResolvers.Add(new TenantDomainResolver("{0}.mydomain.com"));
        });

Tenant Domain Resolver

public class TenantDomainResolver: TenantResolveContributorBase
    {
        public const string ContributorName = "Custom";

        public override string Name => ContributorName;

        private static readonly string[] ProtocolPrefixes = { "http://", "https://" };

        private readonly string _domainFormat;
        public TenantDomainResolver(string domainFormat)
        {
            _domainFormat = domainFormat;
        }
        public override async Task ResolveAsync(ITenantResolveContext context)
        {
            var httpContext = context.GetHttpContext();

            var referer = httpContext.Request.Headers["Referer"].ToString();

            if (string.IsNullOrEmpty(referer))
            {
                return;
            }

            referer = referer.RemovePreFix(ProtocolPrefixes);
            var extractResult = FormattedStringValueExtracter.Extract(referer, _domainFormat, ignoreCase: true);
            if (extractResult != null && extractResult.IsMatch)
            {
                if (extractResult.Matches[0].Value != "abp")  // if referer is not host domain
                {
                    context.Handled = true;
                    context.TenantIdOrName = extractResult.Matches[0].Value;
                }
            }

        }

It's working fine as the host domain 'abp.mydomain.com' from the angular application but when I browse by the 'tenant.mydomain.com' angular application, its calls API 'https://abpapi.mydomain.com/api/abp/multi-tenancy/tenants/by-name/tenant' and throwing an exception as below.

There is no tenant with the tenant id or name: tenant

but when I copy the endpoint URL and directly call in the browser, it's showing the tenant data.

{"success":true,"tenantId":"40cd013e-dfb4-e3e7-e205-3a0653710d75","name":"tenant","isActive":true}

These are the logs of web gateway.

2022-09-16 18:24:23.492 +05:30 [INF] Application started. Press Ctrl+C to shut down. 2022-09-16 18:24:23.492 +05:30 [INF] Hosting environment: Production 2022-09-16 18:24:23.492 +05:30 [INF] Content root path: D:\abp\abp6\publish\web
2022-09-16 18:24:23.516 +05:30 [INF] Request starting HTTP/2 OPTIONS https://abpapi.mydomain.com/api/abp/multi-tenancy/tenants/by-name/tenant - - 2022-09-16 18:24:23.530 +05:30 [INF] CORS policy execution successful. 2022-09-16 18:24:23.541 +05:30 [INF] Request starting HTTP/2 GET https://abpapi.mydomain.com/api/abp/multi-tenancy/tenants/by-name/tenant - - 2022-09-16 18:24:23.542 +05:30 [INF] CORS policy execution successful. 2022-09-16 18:24:23.547 +05:30 [INF] Request finished HTTP/2 OPTIONS https://abpapi.mydomain.com/api/abp/multi-tenancy/tenants/by-name/tenant - - - 204 - - 31.0747ms 2022-09-16 18:24:23.573 +05:30 [INF] Request finished HTTP/2 GET https://abpapi.mydomain.com/api/abp/multi-tenancy/tenants/by-name/tenant - - - 500 - text/html 31.7616ms

I noticed skipIssuerCheck: true. This will help.

I have one more issue here. Can I have different domains specific tenant configuration as the example below?

sub1.domain.com as host sub2.domain.com as tenant tenant1.com as tenant tenant2.co.uk as tenant tenant3.net as tenant

because the tenant may have their own domain instead of the sub-domain of the host domain or they may choose a subdomain as well.

Currently, I am facing the issue of login in with the tenant URL.

Getting below error when trying to login with tenant login page.

vendor.js:169503 invalid issuer in discovery document expected: https://red.api.getabp.net:44322 current: http://api.getabp.net:44322

Configure<IdentityServerOptions>(options =>
        {
            options.IssuerUri = configuration["App:SelfUrl"];
        });

Anybody is there? Need proper documentation on multi-tenancy domain resolver on microservice architecture

Affichage de 11 à 20 sur 51 entrées
Made with ❤️ on ABP v8.2.0-preview Updated on mars 25, 2024, 15:11