Aktivity „michael.sudnik“

Odpoveď

Hi, thanks. Could you also point us in the right direction to make these properties accesible in the UI? We have found the information about overriding paged, but where can we find the original page templates? e.g. registration page, profile page and user management pages. Also, how do we update the relevant application services and DTOs to include these new properties when saving? Is there a nice example that illustrates this? I imagine this would be a fairly common scenario?

Hi, I recently did something similar and ended up referring to this example code https://github.com/EasyAbp/Abp.SettingUi

Maybe the problem is here and the AbpClaimTypes.Email is not available?

https://github.com/abpframework/abp/blob/de7d480af49b5292716a3d130c4602da202388c2/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs#L226

But, the "Register Email" page does seem to populate it ok.

I still have not figured out what is going on. I have tried implementing a custom AbpSignInManager and can see that the ExternalLoginSignInAsync method result has all properties set to false (Failed). The method is also not hitting the PreSignInCheck, which implies that it is failing in the UserManager.FindByLoginAsync(loginProvider, providerKey) method. After investigating what this does, it is suspicious that the user in the database does not have any logins associated with it. I am using MongoDB and am wondering if the logins are not being persisted to the database. Also - the IsExternal property is set to false, which does not seem right. I will keep investigating until someone else can offer any help. Thanks.

How do I get this escalated to the support team?

I have now created a brand new v4.0.0-rc3 version and made only a single modification to the code.

.AddMicrosoftAccount(MicrosoftAccountDefaults.AuthenticationScheme, "Company", options =>
                {
                    options.AuthorizationEndpoint = "https://login.microsoftonline.com/[###MY TENENT ID###]/oauth2/v2.0/authorize";
                    options.TokenEndpoint = "https://login.microsoftonline.com/[##MY TENENT ID###]/oauth2/v2.0/token";
                })

The problem occurs when running locally, without publishing to azure.

The inclusion of the following code, fixes the problem for some reason:

 [Dependency(ReplaceServices = true)]
    [ExposeServices(typeof(RegisterModel))]
    public class CustomRegisterModel : RegisterModel
    {
        protected override async Task RegisterExternalUserAsync(ExternalLoginInfo externalLoginInfo, string emailAddress)
        {
            var user = new IdentityUser(GuidGenerator.Create(), emailAddress, emailAddress, CurrentTenant.Id);

            (await UserManager.CreateAsync(user)).CheckErrors();
            (await UserManager.AddDefaultRolesAsync(user)).CheckErrors();

            var userLoginAlreadyExists = user.Logins.Any(x =>
                x.TenantId == user.TenantId &&
                x.LoginProvider == externalLoginInfo.LoginProvider &&
                x.ProviderKey == externalLoginInfo.ProviderKey);

            if (!userLoginAlreadyExists)
            {
                (await UserManager.AddLoginAsync(user, new UserLoginInfo(
                    externalLoginInfo.LoginProvider,
                    externalLoginInfo.ProviderKey,
                    externalLoginInfo.ProviderDisplayName
                ))).CheckErrors();
            }

            await SignInManager.SignInAsync(user, isPersistent: true);
        }
    }

This appears to work without any problems now that I have upgraded to v4.0.0-rc3

This appears to work without any problems now that I have upgraded to v4.0.0-rc3

Hi,

When i perform the same steps as you to create a new solution (using EF), I can confirm that it works and I can logout and log back in again repeatedly without any problems.

However, when I create a new app using the MongoDB database provider, I then see the incorrect behaviour.

abp new MyApp -t app-pro -u mvc --mobile none --database-provider mongodb --csf --preview

Thanks for looking into it.

If you hit F5 enough, it will go away eventually. When the first one appears, I have been disabling that type of exception until the application has started and then restore it again.

The exception does not appear to be causing any problems with actually running the application.

Zobrazených 1 až 10 z 31 záznamov
Made with ❤️ on ABP v8.2.0-preview Updated on marca 25, 2024, 15:11