jason.curtis (Community Member) asked a question.

Problems creating a user with the Identity REST API

I am in the process of upgrading some automation and moving away from the XML api's. I am trying to just create a user with the Identity API and using the example I keep getting Internal Server error. This is for a regular user, but a saml user.

 

 

http --auth-type=veracode_hmac POST "https://api.veracode.com/api/authn/v2/users" < input.json

The API passes the JSON file that you populate with the necessary values as shown in this example:

{

"email_address": "example@example.com",

"first_name": "Example",

"last_name": "User",

"ipRestricted": false,

"active": true,

"roles": [

{

"role_name": "extseclead"

},

{

"role_name": "extsubmitanyscan"

}

],

"title": "Sample",

"user_name": "example@example.com",

"userType": "VOSP"

}

 

 

Are there more properties required to be successful?

 

 

Please let me know ASAP.. thanks

 

 

 

 

 

 

 

 

 


VCode likes this.
  • Hello @jason.curtis (Community Member)​ ,

     

    For this type of question, I would recommend you contact our technical support team. Here's how you can log a case:

    1. Navigate to the upper right corner of any page in the Community, click on your user avatar.
    2. Select Contact Support from the drop-down menu.

     

    They will be able to help you with this question.

     

    Jason

    Community Support Engineer

    Expand Post
    • jason.curtis (Community Member)

      ​I have done that last week but no response as of yet and I do have the proper roles

  • rich.steenwyk (Community Member)

    @jason.curtis (Community Member)​, I'm having this exact same experience. Were you able to get any assistance from your support case?

    • rich.steenwyk (Community Member)

      I worked with support on this very same issue. Despite the error message from an invalid request indicating that the only required parameters are 'first_', 'last_', and 'user_name' plus 'email_address', sending a request without the 'roles' section is what causes the 500 error.

       

      Additionally, some roles carry additional restrictions that require sending a 'teams' section. Fortunately, a 400 error will clarify this for users.

       

      And finally, sending a request without 'active' set to true will create a user, but one won't be able to find it on the platform via the Administration area.

       

      Thus, the absolute minimum set of parameters for a regular user is:

      {

       "email_address": "name@domain.tld",

       "first_name": "first",

       "last_name": "last",

       "user_name": "name@domain.tld",

       "roles": [

        {

         "role_name": "as needed"

        }

       ],

       "teams": [

        {

         "team_name": "as required"

        }

       ],

       "active": true

      }

       

      And the absolute minimum set of parameters for a SAML user is:

      {

       "email_address": "name@domain.tld",

       "first_name": "first",

       "last_name": "last",

       "user_name": "user",

       "roles": [

        {

         "role_name": "as needed"

        }

       ],

       "teams": [

        {

         "team_name": "as required"

        }

       ],

       "active": true,

      "saml_user": true,

      "saml_subject": "name@domain.tld"

      }

      Expand Post

Topics (3)

No articles found
Loading

Ask the Community

Get answers, share a use case, discuss your favorite features, or get input from the community.