Base solution for your next web application
Open Closed

PostgreeSql #7610


User avatar
0
SASIMEXICO created

Hi,

I have performed the steps indicated on the web (https://aspnetboilerplate.com/Pages/Documents/EF-Core-PostgreSql-Integration) to make the change to PosgreSql with version 4.8.1 so far everything is right. But when I login, I have an error -> MissingMethodException: Method not found: 'System.String IdentityModel.CryptoRandom.CreateUniqueId (Int32)'.

Error:

MissingMethodException: Method not found: 'System.String IdentityModel.CryptoRandom.CreateUniqueId(Int32)'. IdentityServer4.Services.DefaultUserSession.CreateSessionIdAsync(ClaimsPrincipal principal, AuthenticationProperties properties) System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start<TStateMachine>(ref TStateMachine stateMachine) IdentityServer4.Services.DefaultUserSession.CreateSessionIdAsync(ClaimsPrincipal principal, AuthenticationProperties properties) IdentityServer4.Hosting.IdentityServerAuthenticationService.SignInAsync(HttpContext context, string scheme, ClaimsPrincipal principal, AuthenticationProperties properties) in IdentityServerAuthenticationService.cs Microsoft.AspNetCore.Identity.SignInManager<TUser>.SignInAsync(TUser user, AuthenticationProperties authenticationProperties, string authenticationMethod) Abp.Threading.InternalAsyncHelper.AwaitTaskWithPostActionAndFinally(Task actualReturnValue, Func<Task> postAction, Action<Exception> finalAction) in InternalAsyncHelper.cs Abp.Authorization.AbpSignInManager<TTenant, TRole, TUser>.SignInOrTwoFactorAsync(AbpLoginResult<TTenant, TUser> loginResult, bool isPersistent, Nullable<bool> rememberBrowser, string loginProvider, bool bypassTwoFactor) in AbpSignInManager.cs GenTime.Web.Controllers.UiController.Login(LoginModel model) in UiController.cs + var signInResult = await _signInManager.SignInOrTwoFactorAsync(loginResult, model.RememberMe); Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor+TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, object controller, object[] arguments) Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync() Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync() Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync() Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextExceptionFilterAsync() Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ExceptionContext context) Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter() Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context) Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync() Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync() Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext) Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.Invoke(HttpContext httpContext) Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext) Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context) IdentityServer4.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IEndpointRouter router, IUserSession session, IEventService events) in IdentityServerMiddleware.cs IdentityServer4.Hosting.MutualTlsTokenEndpointMiddleware.Invoke(HttpContext context, IAuthenticationSchemeProvider schemes) in MtlsTokenEndpointMiddleware.cs Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.InvokeCore(HttpContext context) IdentityServer4.Hosting.BaseUrlMiddleware.Invoke(HttpContext context) in BaseUrlMiddleware.cs Abp.AspNetZeroCore.Web.Authentication.JwtBearer.JwtTokenMiddleware+<>c__DisplayClass0_0+<<UseJwtTokenMiddleware>b__0>d.MoveNext() Abp.AspNetZeroCore.Web.Authentication.JwtBearer.JwtTokenMiddleware+<>c__DisplayClass0_0+<<UseJwtTokenMiddleware>b__0>d.MoveNext() Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.InvokeCore(HttpContext context) Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Any idea of the reason?

Regards.


7 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Did you try to disable Identity Server in appsettings.json ?

    Thanks,

  • User Avatar
    0
    SASIMEXICO created

    Hi,

    Yes, when disable Identity Server in appsettings.json it works correctly. But if I do this, I can't use Identity, no?

    Thanks,

  • User Avatar
    0
    maliming created
    Support Team

    hi SASIMEXICO

    What version of the IdentityServer4 and IdentityServer4.AccessTokenValidation packages are you using?

  • User Avatar
    0
    SASIMEXICO created

    Hi,

    The version of IdentityServer4 is 2.5.0 and IdentityServer4.AccessTokenValidation is 2.7.0.

    Regards

  • User Avatar
    0
    maliming created
    Support Team

    @SASIMEXICO

    Can you share your project code? [email protected]

  • User Avatar
    0
    maliming created
    Support Team

    hi @SASIMEXICO

    Please use the 3.10.10 version of IdentityModel.

    https://www.nuget.org/packages/IdentityModel/3.10.10

  • User Avatar
    0
    SASIMEXICO created

    Hi,

    Perfect, I have degraded the nuget package to version 3.10.10 and now it works correctly.

    Thanks for all.

    Regards

    Toni