Jump to content
We've recently updated our Privacy Statement, available here ×

Get error 400:bad request when I add roles to Create User REST v2


vgaikwad

Recommended Posts

I am not sure what is going worng with the create user api with roles. 

Observations:

1. When fired without the roles it works fine, the payload is given below

{

  "fullName": "unittestuser",

  "emailAddress": null,

  "enabled": true,

  "password": "39HN=K?E",

  "roles": null

}

2. when same endpoint is invoked with the addition of roles then it fails giving the http error code 400 (bad request)

{

  "fullName": "unittestuser",

  "emailAddress": null,

  "enabled": true,

  "password": "39HN=K?E",

  "roles": [

    {      "name": "unittest"    },

    {      "name": "UsernamePasswordAuthentication"    },

    {      "name": "Platform_NamedUser"    },

    {      "name": "Platform_Anyone"    },

    {      "name": "Platform_Metadata_MetadataInitializeUser"    }

  ]

}

3. The roles part works when the default roles shipped with Jaspersoft server installation are sent. 

{

  "fullName": "unittestuser3",

  "emailAddress": null,

  "externallyDefined": false,

  "enabled": true,

  "password": "39HN=K?E",

   "roles": [

    {      "name": "ROLE_USER"    },

     {      "name": "ROLE_ADMINISTRATOR"    }

  ]

}

 

 

I have checked the the new roles which I have created are present on the Jasperserver before the create user is hit, so I am not sure what is going wrong with the newly created roles. I am using REST api v2 for role creation as well as user creation.

Let me know if anyone has a clue.

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...