Activities of "isaac.yip@cpy.com.hk"

Blazor server

In the OnGetExternalLoginCallbackAsync function (login.html.cs), I found that calling signin two times there if the the signin result is not success but without signout. May I know the reason?

var result = await SignInManager.ExternalLoginSignInAsync(
            loginInfo.LoginProvider,
            loginInfo.ProviderKey,
            isPersistent: true,
            bypassTwoFactor: true
        );

        if (!result.Succeeded)
        {
            await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext
            {
                Identity = IdentitySecurityLogIdentityConsts.IdentityExternal,
                Action = "Login" + result
            });
        }

After added login info or created external user, it call signin method again.

var externalUser = await UserManager.FindByEmailAsync(email);
        if (externalUser == null)
        {
            externalUser = await CreateExternalUserAsync(loginInfo);
        }
        else
        {
            if (await UserManager.FindByLoginAsync(loginInfo.LoginProvider, loginInfo.ProviderKey) == null)
            {
                CheckIdentityErrors(await UserManager.AddLoginAsync(externalUser, loginInfo));
            }
        }

        if (await HasRequiredIdentitySettings())
        {
            Logger.LogWarning($"New external user is created but confirmation is required!");

            await StoreConfirmUser(externalUser);
            return RedirectToPage("./ConfirmUser", new {
                returnUrl = ReturnUrl,
                returnUrlHash = ReturnUrlHash
            });
        }

        await SignInManager.SignInAsync(externalUser, false);

For the First login, I found that the result from ExternalLoginSignInAsync is not success. Can I add the signout there? Will it cause any problems?

if (!result.Succeeded)
        {
            await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext
            {
                Identity = IdentitySecurityLogIdentityConsts.IdentityExternal,
                Action = "Login" + result
            });
            await SignInManager.SignOutAsync();
        }

deployed

Already increased the request size. Still not work.

Thanks. It works now.

Checked. No record in the Redis.

It works now. Thank you.

Can you call the sample endpoint on gateway from the URL: https://localhost:44325/api/notification-service/sample ?

Can

If so, try adding the [Route] attribute to GetAsync method in SampleController:

Added. And throw the same exception.

I create a new project with microservice template, blazor ui and the problem still here.

Are you using microservice template and blazor ui?

blazor log:

2022-04-28 16:23:00.480 +08:00 [INF] Start processing HTTP request GET "https://localhost:44325/api/abp/api-definition"
2022-04-28 16:23:00.481 +08:00 [INF] Sending HTTP request GET "https://localhost:44325/api/abp/api-definition"
2022-04-28 16:23:00.678 +08:00 [INF] Received HTTP response headers after 197.4185ms - 200
2022-04-28 16:23:00.678 +08:00 [INF] End processing HTTP request after 198.2306ms - 200
2022-04-28 16:23:00.694 +08:00 [WRN] Unhandled exception rendering component: Could not found remote action for method: System.Threading.Tasks.Task`1[MOS.NotificationService.Samples.SampleDto] GetAsync() on the URL: https://localhost:44325/
Volo.Abp.AbpException: Could not found remote action for method: System.Threading.Tasks.Task`1[MOS.NotificationService.Samples.SampleDto] GetAsync() on the URL: https://localhost:44325/
   at Volo.Abp.Http.Client.DynamicProxying.ApiDescriptionFinder.FindActionAsync(HttpClient client, String baseUrl, Type serviceType, MethodInfo method)
   at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor`1.GetActionApiDescriptionModel(IAbpMethodInvocation invocation)
   at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor`1.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
   at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at MOS.NotificationService.Blazor.Pages.NotificationService.Test.SendEmail() in C:\Users\isaac.yip\Desktop\MOS\MOS_20220420\services\notification\src\MOS.NotificationService.Blazor\Pages\NotificationService\Test.razor.cs:line 52
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Radzen.Blazor.RadzenButton.OnClick(MouseEventArgs args)
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
2022-04-28 16:23:00.699 +08:00 [ERR] Unhandled exception in circuit '6PBxuosO4MUMXMmuyj7DgkoJVB-SLUH8afvlBwE4kl8'.
Volo.Abp.AbpException: Could not found remote action for method: System.Threading.Tasks.Task`1[MOS.NotificationService.Samples.SampleDto] GetAsync() on the URL: https://localhost:44325/
   at Volo.Abp.Http.Client.DynamicProxying.ApiDescriptionFinder.FindActionAsync(HttpClient client, String baseUrl, Type serviceType, MethodInfo method)
   at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor`1.GetActionApiDescriptionModel(IAbpMethodInvocation invocation)
   at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor`1.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
   at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at MOS.NotificationService.Blazor.Pages.NotificationService.Test.SendEmail() in C:\Users\isaac.yip\Desktop\MOS\MOS_20220420\services\notification\src\MOS.NotificationService.Blazor\Pages\NotificationService\Test.razor.cs:line 52
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Radzen.Blazor.RadzenButton.OnClick(MouseEventArgs args)
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
2022-04-28 16:23:00.776 +08:00 [INF] Executed endpoint '/_blazor'
2022-04-28 16:23:00.777 +08:00 [INF] Request finished HTTP/1.1 GET https://localhost:44314/_blazor?id=pczk1P-5gdFs1D621NRtHA - - - 101 - - 68037.4493ms

web-gateway log:

2022-04-28 16:23:00.490 +08:00 [INF] Request starting HTTP/1.1 GET https://localhost:44325/api/abp/api-definition - -
2022-04-28 16:23:00.490 +08:00 [DBG] requestId: 0HMH8U0DU0PFU:00000002, previousRequestId: no previous request id, message: ocelot pipeline started
2022-04-28 16:23:00.490 +08:00 [DBG] requestId: 0HMH8U0DU0PFU:00000002, previousRequestId: no previous request id, message: Upstream url path is /api/abp/api-definition
2022-04-28 16:23:00.490 +08:00 [DBG] requestId: 0HMH8U0DU0PFU:00000002, previousRequestId: no previous request id, message: downstream templates are /api/abp/{everything}
2022-04-28 16:23:00.491 +08:00 [INF] requestId: 0HMH8U0DU0PFU:00000002, previousRequestId: no previous request id, message: EndpointRateLimiting is not enabled for /api/abp/{everything}
2022-04-28 16:23:00.491 +08:00 [INF] requestId: 0HMH8U0DU0PFU:00000002, previousRequestId: no previous request id, message: No authentication needed for /api/abp/api-definition
2022-04-28 16:23:00.491 +08:00 [INF] requestId: 0HMH8U0DU0PFU:00000002, previousRequestId: no previous request id, message: /api/abp/{everything} route does not require user to be authorized
2022-04-28 16:23:00.491 +08:00 [DBG] requestId: 0HMH8U0DU0PFU:00000002, previousRequestId: no previous request id, message: Downstream url is https://localhost:44367/api/abp/api-definition
2022-04-28 16:23:00.677 +08:00 [INF] requestId: 0HMH8U0DU0PFU:00000002, previousRequestId: no previous request id, message: 200 (OK) status code, request uri: https://localhost:44367/api/abp/api-definition
2022-04-28 16:23:00.677 +08:00 [DBG] requestId: 0HMH8U0DU0PFU:00000002, previousRequestId: no previous request id, message: setting http response message
2022-04-28 16:23:00.677 +08:00 [DBG] requestId: 0HMH8U0DU0PFU:00000002, previousRequestId: no previous request id, message: no pipeline errors, setting and returning completed response
2022-04-28 16:23:00.677 +08:00 [DBG] requestId: 0HMH8U0DU0PFU:00000002, previousRequestId: no previous request id, message: ocelot pipeline finished
2022-04-28 16:23:00.678 +08:00 [INF] Request finished HTTP/1.1 GET https://localhost:44325/api/abp/api-definition - - - 200 54537 application/json;+charset=utf-8 188.1015ms

microservice no request made here

Showing 1 to 10 of 14 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11