auth0 / auth0-java

Java client library for the Auth0 platform
https://auth0.com
MIT License
286 stars 131 forks source link

Add groups and dn to User Pojo #538

Closed victorhua closed 1 year ago

victorhua commented 1 year ago

Checklist

Describe the problem you'd like to have solved

We are calling GET api/v2/users endpoint to get user information.

It seems User doesn't have groups and dn properties.

Describe the ideal solution

Please add them.

Alternatives and current workarounds

No response

Additional context

No response

jimmyjames commented 1 year ago

đź‘‹ hi @victorhua, thanks for raising! Can you provide an example of these properties as returned by the API? I don't see a group or dn property when I make a request to list users. Thanks!

victorhua commented 1 year ago

I think these fields are only available when the connection is a SAML, it may also depend on the SAML configuration. example: # { ... "Groups": [ “Dev”, “Admin” ], "dn": "CN=TEST,OU=Testing,OU=HQ,OU=Users,OU=Test_HQ,OU=Testing,DC=US,DC=test”, ... }

Is it possible to pass in a customized POJO class in this case?

jimmyjames commented 1 year ago

Hi @victorhua, thanks for the info! We'll see if there's a nice way we can support this.

jimmyjames commented 1 year ago

Ah, this has come up before and was addressed in https://github.com/auth0/auth0-java/pull/56. You can use the getValues() method on the User to get a map of values, which in this case would contain the groups array and dn value. Let me know if that works for you, thanks!

jimmyjames commented 1 year ago

Closing as this info can be retrieved via the getValues() method discussed above.