Base solution for your next web application

Activities of "botcoredev"

Hi Guys,

I happened to find out that, I cant even able to register a normal user in the website.

In the register.cshtml page it showing this:

What's happening, can somebody please explain to me, what it is.

Please guys help me resolve this becoz, I happen to notice this for production env only. Locally its working as expected.

Thanks in advance.

Hi @CrayonGroupSCA and ismcagdas,

I used remote debugging, and found out the error comes in UserRegistrationManager.cs >> RegisterAsync(string name, string surname, string emailAddress, string userName, string plainPassword, bool isEmailConfirmed, string emailActivationLink):

        await _userManager.InitializeOptionsAsync(AbpSession.TenantId);
        CheckErrors(await _userManager.CreateAsync(user, plainPassword));
        await CurrentUnitOfWork.SaveChangesAsync();
        

line no : 86,87,88

here it cannot able to get create the new user. I am getting all the values for user. But still it throws an error.

Here is the plain password:

as you can notice its getting all the values but still unable to create new user and throws error.

Hi @CrayonGroupSCA,

All the configurations working for localhost, but it throws an error in production.

I am able to register a user in localhost, but in production it throw an error. Please look into below pic:

I am able to get authenticated in o3665, but after that when it ask to register, it trows this error.

this is the console error. Please help me solve this.

Thanks in Advance.

Hi @CrayonGroupSCA ,

I solved the issue.

public virtual string GetUserNameFromClaims(List<Claim> claims) { if (claims.Where(x => x.Type == ClaimTypes.Email).Any()) { return claims.First(c => c.Type == ClaimTypes.Email)?.Value.ToMd5(); } else if (claims.Where(x => x.Type ==** ClaimTypes.Name**).Any()) { return claims.First(c => c.Type == ClaimTypes.Name)?.Value.ToMd5(); }

		return null;
		//return claims.First(c => c.Type == ClaimTypes.Email)?.Value.ToMd5();
	}

Its running perfectly now.

Lot of thanks guys.

Hi @CrayonGroupSCA,

I did the changes as you mentioned, and its working upto a point where NewUser needs to be registered.

    public virtual string GetUserNameFromClaims(List&lt;Claim&gt; claims)
    {
		if (claims.Where(x => x.Type == ClaimTypes.Email).Any())
		{
			return claims.First(c => c.Type == ClaimTypes.Email)?.Value.ToMd5();
		}
		else if (claims.Where(x => x.Type == "preferred_username").Any())
		{
			return claims.First(c => c.Type == "preferred_username")?.Value.ToMd5();
		}

		return null;
        //return claims.First(c => c.Type == ClaimTypes.Email)?.Value.ToMd5();
    }
    

here I am not getting the email as you suggested.

After that I am getting redirected to "Register" page where I am entering the email and then click register.

Then it goes to Register() in line no: 446 in Account controller, from there it navigates to UserRegistrationManager.cs >>> RegisterAsync() >> in line no 78 : user.SetNormalizedNames(); and throws an error.

please help me resolve this and i am good to go.

And thank you very much guys.

Hi @ismcagdas,

After adding the "social-login-icon" class to the <a>, it became a button, but it always returns to the login page only. "http://localhost:62114/Account/Login?ReturnUrl=%2FAccount%2FExternalLoginCallback%3FReturnUrl%3D%252FAdminPortal"

As @Dave asked do we need to pass some value for "provider"?

Thanks in advance.

Hi @ismcagdas,

Please can help me with this because I followed the docs, but in there they haven't explained it properly.

I am in a hurry. Please respond as soon as you can.

Yes, I am using Asp .Net Core MVC with JQuery.

I configured the Identitysrever config along with openID Connect config.

After making openID=> IsEnabled "true", I am getting the "openId" button in login page. On click its not redirecting to O365 login page as it supposed to be.

As checked, the (href="#") is like this for openIdConnect button.

I configured all the details for OpenId in appsettings.json. According to documents it is supposed to working.

Here is my configs:

"OpenId": { "IsEnabled": "true", "Authority": "https://login.microsoftonline.com/xxxxxxxxxTenentIDxxxxxxxx", "LoginUrl": "https://login.microsoftonline.com/xxxxxxxxxTenentIDxxxxxxxx/oauth2/authorize", "ClientId": "xxxxxxxxxClientIDxxxxxxxx", "ClientSecret": "xxxxxxxxxClientSecretxxxxxxxx", "ValidateIssuer": "false", "ClaimsMapping": [ { "claim": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", "key": "http://schemas.microsoft.com/identity/claims/objectidentifier" } ] }

Here is the portion in Login.cshtml, where "openidconnect" button is getting rendered.

            @foreach (var p in loginProviders)
            {
                &lt;a href=&quot;#&quot; class=&quot;btn btn-outline-secondary kt-btn btn-sm&quot;&gt;
                    &lt;i class=&quot;fab fa-@getSocialIconClass(p.DisplayName)&quot;&gt;&lt;/i&gt;
                    @p.DisplayName
                &lt;/a&gt;
            }
            

What am I doing wrong, can you please help me solve this. Because its very important feature, which needs to be integrated for our product.

Thanks in advance.

Hi,

Requirement : Login with Microsoft/Azure AD Users as an option in Login page. **Trails: ******

  1. Using App Registration in Azure Active Directory.https://docs.microsoft.com/en-us/azure/app-service/configure-authentication-provider-microsoft
  2. Using Open ID Connect. https://docs.aspnetzero.com/documents/aspnet-core-mvc/latest/Infrastructure-Core-Mvc-Identity-Server4-Integration

Please help me for sign in to Azure AD/ Microsoft.

Thanks in Advance.

Showing 1 to 10 of 18 entries