Create User with Python when SSO is enabled | XM Community
Skip to main content
Solved

Create User with Python when SSO is enabled

  • February 25, 2020
  • 5 replies
  • 118 views

Forum|alt.badge.img+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!

Best answer by MsIreen

@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.

5 replies

MsIreen
Level 5 ●●●●●
Forum|alt.badge.img+23
  • Level 5 ●●●●●
  • February 26, 2020
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.

Forum|alt.badge.img+3
  • Author
  • Level 2 ●●
  • February 26, 2020
@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?

MsIreen
Level 5 ●●●●●
Forum|alt.badge.img+23
  • Level 5 ●●●●●
  • Answer
  • February 26, 2020
@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.

Forum|alt.badge.img+3
  • Author
  • Level 2 ●●
  • February 26, 2020
@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