Create User with Python when SSO is enabled | XM Community
Solved

Create User with Python when SSO is enabled

  • 25 February 2020
  • 5 replies
  • 36 views

Userlevel 3
Badge +3
I am attempting to learn how to create users through python using the script found here
Our Brand is SSO enabled so the usernames have #brandid appended to them. This is referenced at this support page, but I am not sure what to enter for the password field. The api documentation says password is required but I do not know what I would enter since these users will use SSO.

Would appreciate any guidance here, thank you!
icon

Best answer by MsIreen 26 February 2020, 21:01

View original

5 replies

Userlevel 7
Badge +23
Check this out: https://stackoverflow.com/questions/3854692/generate-password-in-python you will not need the password anyway after the user has been created.
Userlevel 3
Badge +3
@MsIreen so basically the password I put doesn't matter. Having the #brandid means the users SSO information will be taken and that initial password is irrelevant. Am I understanding that correctly?
Userlevel 7
Badge +23
@chasemcl yes, it is irrelevant. Even when creating users manually i just generate a random password. The main thing is that the SSO is picking up the correct login.
Userlevel 3
Badge +3
@MsIreen Thank you!

Run the following command:

  1. $ python manage.py createsuperuser. Enter your desired username and press enter.

  2. Username: admin. You will then be prompted for your desired email address:

  3. Email address: admin@example.com. ...

  4. Password: ********** Password (again): ********* Superuser created successfully.

Regards- Python Training in Pune

Leave a Reply