Activities of "ademaygun"

Hi liangshiwei, Thanks for your support!

Hi liangshiwei, If I write the example code exactly as below, it creates a user in the AbpUsers table. If I log in again with the same user through an external provider, this time the CreateExternalUserAsync method is not triggered. Your suggestion works and is effective, but it means that the method (CreateExternalUserAsync) will always check whether the user exists before being called

[ExposeServices(typeof(LoginModel))]
public class MyLoginModel : LoginModel
{
    protected virtual async Task<IdentityUser> CreateExternalUserAsync(ExternalLoginInfo info)
    {
        var user = await base.CreateExternalUserAsync(info);
    }
}

adding external Login provider :

private void ConfigureExternalProviders(ServiceConfigurationContext context, IConfiguration configuration)
    {
        context.Services.AddAuthentication()
 .AddOpenIdConnect("oidc", options =>
 {
     options.Authority = "https://localhost:44366/";
     options.RequireHttpsMetadata = Convert.ToBoolean(configuration["AuthServer:RequireHttpsMetadata"]); ;
     options.ResponseType = OpenIdConnectResponseType.CodeIdToken;
     options.ClientId = "Client1";
     options.ClientSecret = "mysecret";

     options.UsePkce = true;
     options.SaveTokens = true;
     options.GetClaimsFromUserInfoEndpoint = true;
     options.Scope.Add("role");
     options.Scope.Add("email");
     options.Scope.Add("phone");
     options.ClaimActions.MapJsonKey(ClaimTypes.NameIdentifier, "sub");
 }
    );

Hi Liangshiwei,

Thank you for your response, I appreciate your answer and I understand it very well. However, it seems like a workaround solution. I want to override the place where the decision to trigger this method is made. Even if I override the CreateExternalUserAsync method, it will still attempt to find the user every time and not be able to find it

Hi, After a successful login from an external login provider, I want to manually check whether the user exists in my system and then when I find the appropriate user, log them into my system (especially for tenant users)

Hello Anjali_Musmade,

Thank you for your response. It was definitely helpful to see this question. However, if possible, resolving the issue at its source is always a better solution. I'm curious about the following:

Would using ArgumentException instead of BusinessException in the Check class called within the Entity be a preference or a necessity? Because before .NET 7, we couldn't perform dependency injection into entity classes. Therefore, was it a necessity to use exceptions of type ArgumentException in entity classes due to the inability to localize them, or was it a deliberate choice?

About 10 months ago, Halil İbrahim Kalkan published an impressive article. I would like to see the adaptation of the Abp Suite's entity and manager classes in accordance with this article.

Hi @maliming,

The code you provided worked, thank you very much for your support

yes, thanks for your attention

We've identified the source of the problem. We have an Nginx server in the DMZ, and other requests are also coming to this project. In the past, another Abp project with version 5.1.4 (IdentityServer) used to handle other requests, but it didn't throw any errors.

The request causing the error: (nginx access log) X.X.X.X - - [05/Sep/2023:16:07:47 +0300] "GET /swagger HTTP/1.1" 500 177 "https://[A.B.C.D]/" "Go-http-client/1.1"

X.X.X.X is our test server, which has Grafana installed and sends these requests.

Hi Maliming, The error is still occurring.Unfortunately, we cannot share the source code. If possible, can we meet via Google Meet? Can you share your Gmail address and your available time with us

Hi Anjali_Musmade, The same error is appearing in the logs every 2 seconds on its own. We've turned off Healthcheck, so it's not the cause. We've checked all of our URLs, and there doesn't appear to be any issue. We don't experience this problem in the test environment; it only occurs in the production environment

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