Create user on different user provider
Question

Hello,

I'm developing a new application which consists in 2 espaces:

Espace 1: accessible by company users, using a specific user provider that we created based on what we need.

Espace 2: accessible by our customers, using the default user provider, but in a specific tenant.


On Espace 1, our company users need to be able to create the users that will access espace 2, but when i try to use CreateOrUpdate_User from the default users module, it creates on the specific user provider that we have, and not on the default one. If i try to do a TenantSwitch before the create action, it throws me an error stating that i can't switch to a tenant from a different user provider.

Doing an advanced query with insert statement works fine, but when trying to log in it throws invalid username or password, probably because of the password encryption method.


Any ideais on how to achieve this?

Thanks.

mvp_badge
MVP
Solution

Hi Rafael ,

When you use a different user provider and than Users (Default)  and use it in other application than at the time of login platform internally matches this users with the users who are created using the new user Provider and not with the users created by default User Provider .

You have to create users with the new user provider and than you can use these user to login wherever you are using this module as User Provider.


Regards,

-PJ- 

Hi Pramod,

I created a rest on the module which uses the default UserProvider, and in this rest i call the CreateOrUpdate action from Users module. Then, on my other application which uses a custom UserProvider, i call this rest and was able to create and login the User on the correct tenant.

Thanks for the help.

mvp_badge
MVP

Hi Rafael,

Did you use the EncryptPassword action?


Hello Leandro,

Yes, i did use EncryptPassword when doing a directly insert, but when using the default Login action from User Provider, i keep getting wrong username or password.

mvp_badge
MVP
Solution

Hi Rafael ,

When you use a different user provider and than Users (Default)  and use it in other application than at the time of login platform internally matches this users with the users who are created using the new user Provider and not with the users created by default User Provider .

You have to create users with the new user provider and than you can use these user to login wherever you are using this module as User Provider.


Regards,

-PJ- 

Hi Pramod,

I created a rest on the module which uses the default UserProvider, and in this rest i call the CreateOrUpdate action from Users module. Then, on my other application which uses a custom UserProvider, i call this rest and was able to create and login the User on the correct tenant.

Thanks for the help.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.