abp icon indicating copy to clipboard operation
abp copied to clipboard

Cant reset user password in UserManagement module

Open julian-forster opened this issue 3 years ago • 2 comments

I'm not able to reset the password of a user via the usermanagement module (url: /identity/users). In the PR #1942 it seemed that the functionality was added but then later got removed?

Screenshot: image

ABP Framework version: 5.3 User Interface: Angular Database provider: EF Core

Steps needed to reproduce:

  1. create a new default project via the cli.
  2. Log in as the default admin
  3. Navigate to /identity/users and create a new user
  4. Edit the created user (Actions -> Edit)
  5. Cant change / update the user password

julian-forster avatar Aug 02 '22 18:08 julian-forster

I have added the password section on Edit Modal. Probably It will release with Rel-6.0 you don't have to wait. here it is the PR https://github.com/abpframework/abp/pull/13584

you can implement it with the dynamic form extension system https://docs.abp.io/en/abp/latest/UI/Angular/Dynamic-Form-Extensions

  • Go to app-routing.module.ts
  • Create a custom Contributor. (I added an example )

app-routing.module.ts

 {
    path: 'identity',
    loadChildren: () =>
      import('@volo/abp.ng.identity').then(m =>
        m.IdentityModule.forLazy({
          editFormPropContributors: identityEditFormContributors,
        }),
      ),
  },

identityEditFormContributors.ts


export const identityEditFormContributors: IdentityCreateFormPropContributors = {
  [eIdentityComponents.Users]: [userEditFormContributor],
};

userEditFormContributor.ts

const passwordField = new FormProp<IdentityUserDto>({
  type: ePropType.Password,
  name: 'password',
  displayName: 'AbpIdentity::Password',
  id: 'password',
  autocomplete: 'new-password',
  validators: _ => [Validators.required],
  asyncValidators: customAsyncPasswordValidator,
});

export function userEditFormContributor(formProps: FormPropList<IdentityUserDto>) {
  formProps.addAfter(passwordField, 'userName', (value, name) => value.name === name);
}

mahmut-gundogdu avatar Aug 05 '22 13:08 mahmut-gundogdu

One question? Should host then be able to reset tenants passwords because Im missing that option in 5.3.4

sturlath avatar Sep 11 '22 07:09 sturlath

What do you mean by resetting Tenant password. A tenant doesn't have a password but a list of users.

ebicoglu avatar Sep 28 '22 12:09 ebicoglu

Only resetting tenant admin's password could be possible, if we implement it. However, they can easily reset their own passwords using "forgot password" page.

hikalkan avatar Sep 28 '22 12:09 hikalkan

I think it would be a great feature resetting the tenant's admin password.

julian-forster avatar Sep 28 '22 12:09 julian-forster

What I meant @ebicoglu was as a Host you should be able to select tenant admin users and reset their psswords.

sturlath avatar Sep 28 '22 12:09 sturlath

I am closing this, we will track this internally and decide if we can implement this.

hikalkan avatar Sep 28 '22 13:09 hikalkan

BTW, setting password is possible via ABP Commercial Identity Pro module. But setting password of an admin user is a different thing, because the SaaS or Tenant Management module has no dependency to the Identity module.

hikalkan avatar Sep 28 '22 13:09 hikalkan