Auth0 Home Blog Docs

How to assign roles to a user with java management api

There is no information about how to make it using java management api

Hey there @KevinKons!

I’m not sure if I understand what you mean. Our APIs as every API can be called using multiple languages and are based on http requests so it’s basically getting the grasp how to call any API in java.

Here’s the endpoint for it:

Unfortunately we don’t have enough capacity to provide instructions on calling our APIs in every language. You can always submit a feature request using our feedback site that is directly transitioned to our product team:

What i mean with Java management API is actually the library of the management API for Java: https://github.com/auth0/auth0-java

I tried to change the roles of a user with the java library and with http request and didnt achieve success in both. Fot the http request case I created a new post: Management API v2 /api/v2/users/{id}/roles gives error 400 with message Schema violation

Okay gotchya! Sorry for misunderstanding!

Can you try creating an issue in that repo so that repo maintainers can immediately take a look at it?

Hey there @KevinKons!

In the meantime can you post here code snippets how you tried to achieve this and at what steps you failed so maybe someone from the community will be able to guide you in the right direction?

Thank you!

Hey there!

Have you had a chance to see my last message?

1 Like

Yes I had. Sorry for not replying.
I discovered the problem. I was trying to manage the roles via Management API v2, while I am using Authorization Extension, therefore it would never work. Once I started sending the requests to the Authorization Extension, it worked as it should.

1 Like

Perfect! Glad you have it working in the end!

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.