Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue: Core Authorization fails when adding Roles to User #198

Closed
6 tasks done
jakbutler opened this issue Apr 25, 2019 · 0 comments
Closed
6 tasks done

Issue: Core Authorization fails when adding Roles to User #198

jakbutler opened this issue Apr 25, 2019 · 0 comments

Comments

@jakbutler
Copy link
Contributor

Description

The new Core Authorization support is sending a list of Role objects when assigning roles to a User via the UserEntity. The API is expecting a list of Strings.

Prerequisites

Environment

  • Version of this library used: 1.13.0
  • Version of Java used: jdk1.8.0_102
  • Additional libraries that might be affecting your instance: N/A

Reproduction

Calling the addRoles or removeRoles endpoints via the UsersEntity, as below, returns a 400 error:

// in this example, role is of type com.auth0.json.mgmt.Role
getManagementAPI().users().addRoles("userId", Collections.singletonList(role)).execute()
{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "Payload validation error: \u0027Expected type string but found type object\u0027 on property roles[0].",
  "errorCode": "invalid_body"
}
jakbutler pushed a commit to jakbutler/auth0-java that referenced this issue Apr 25, 2019
… user using only role id strings, not the whole Role object.
lbalmaceda added a commit that referenced this issue Apr 25, 2019
Fix for issue #198: Core Authorization fails when adding Roles to User
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants