vgaikwad Posted December 26, 2016 Share Posted December 26, 2016 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 More sharing options...
hozawa Posted December 26, 2016 Share Posted December 26, 2016 Had the same problem. I think it was that JasperReports Server wants the user created first and then roles assigned (using PUT).http://community.jaspersoft.com/documentation/tibco-jasperreports-server-rest-api-reference/v630/users-service#Modifying_User_Properties Link to comment Share on other sites More sharing options...
vgaikwad Posted December 26, 2016 Author Share Posted December 26, 2016 @hozawa - I got the same error even after trying insert and then update. Basically the request does not have any difference in create and update, both are http 'put'. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now