Create User / Batch Create Users in Asgardeo User Management API with Auto Generated Password

93 views Asked by At

Just want to ask how we can create a user using Asgardeo User Management API without providing a password?

Basically we want to replicate this flow but instead of manually doing it on the console, we want to do it from the User Management API. enter image description here

Here are some of the Endpoints that we tested

POST https://api.asgardeo.io/t/asgardeo/scim2 /Users

POST https://api.asgardeo.io/t/asgardeo/scim2 /Bulk

The password field seems to be a required field.

1

There are 1 answers

1
GoushiRam On BEST ANSWER

Setting the urn:scim:wso2:schema with "askPassword":"true" should allow you to create the users without providing the password.

Sample Payload of the scim https://api.asgardeo.io/t/tenantName/scim2/Users:

{
"emails":
[
    {
    "primary":true,
    "value":"<User Email>"
    }
],
"name":
{
    "familyName":"",
    "givenName":""
    },
"urn:scim:wso2:schema":
{
    "askPassword":"true"
},
"userName":
    "DEFAULT/<User Email>"
}

The will receive the invite request similar to the UI function.

Same approach can be taken with the Bulk endpoint too as mentioned this medium blog