Activities of "kapil"

Is theexternalUser null?

If your system username must contain spaces, you can override IUserValidator<TUser> or add space to AllowedUserNameCharacters

externalUser

public override async Task<Volo.Abp.Identity.IdentityUser> CreateUserAsync(string userName, string providerName)
{
    await IdentityOptions.SetAsync();

    var externalUser = await GetUserInfoAsync(userName);
    NormalizeExternalLoginUserInfo(externalUser, userName);

    var user = new Volo.Abp.Identity.IdentityUser(
        GuidGenerator.Create(),
        userName,
        externalUser.Email,
        tenantId: CurrentTenant.Id
    );

    user.Name = externalUser.Name;
    user.Surname = externalUser.Surname;

    user.IsExternal = true;

    user.SetEmailConfirmed(externalUser.EmailConfirmed ?? false);
    user.SetPhoneNumber(externalUser.PhoneNumber, externalUser.PhoneNumberConfirmed ?? false);

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

    if (externalUser.TwoFactorEnabled != null)
    {
        (await UserManager.SetTwoFactorEnabledAsync(user, externalUser.TwoFactorEnabled.Value)).CheckErrors();
    }

    (await UserManager.AddDefaultRolesAsync(user)).CheckErrors();
    (await UserManager.AddLoginAsync(
                user,
                new UserLoginInfo(
                    providerName,
                    externalUser.ProviderKey,
                    providerName
                )
            )
        ).CheckErrors();

    return user;
}

but in "cn" attribue have space how i can remove.

Can you share more details?

if i removed space from username then following error occured

Did you add any custom code?

which type of details you need?

Yes,i added the code for CreateUserAsync.

but in "cn" attribue have space how i can remove.

Can you share more details?

If your system username must contain spaces, you can override IUserValidator<TUser> or add space to AllowedUserNameCharacters if i removed space from username then following error occured

hi

Can you remove the space from the username?

https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.identity.useroptions.allowedusernamecharacters?view=aspnetcore-6.0

but in "cn" attribue have space how i can remove.

hi

See https://docs.abp.io/en/commercial/latest/modules/account/ldap#customize-built-in-services

yes, i do same but this error is thrown.

i dont have "uid" attribute becaue is null i am using "cn" attribue which give this error.

You can add a MyEmailSender service, then copy the code from the EmailSendDemo to send the mail.

context.Services.Replace(ServiceDescriptor.Transient<IEmailSender, MyEmailSender>()); 

https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/NullEmailSender.cs#L13

Ok thanks sir It's working fine. Thanks for support.

i created new project and publish in IIS but same error is thrown

Are you using a new database?

yes sir

Can you test the EmailSendDemo console app on your server?

Yes it's work fine.

i created new project and publish in IIS but same error is thrown
Error:-> System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first. k9sm845219pgr.47 - gsmtp

Showing 21 to 30 of 42 entries
Made with ❤️ on ABP v9.1.0-rc.1. Updated on January 17, 2025, 14:13