How to get custom attributes of a user using Okta Client Java SDK API? Skip to main content
https://support.okta.com/help/answers?id=906f0000000hzygiac&refurl=http%3a%2f%2fsupport.okta.com%2fhelp%2fanswers
How satisfied are you with the Okta Help Center?
Thank you for your feedback!
How satisfied are you with the Okta Help Center?
1
2
3
4
5
Very Dissatisfied
Very satisfied
Enter content less than 200 characters.
Ask Search:
Ona AllisonOna Allison 

How to get custom attributes of a user using Okta Client Java SDK API?

I am using Okta Client Java SDK for fetching list of users in okta. For each user I want to access custom attributes and their values. However, when I navigate through "com.okta.sdk.models.users.User" object, I am not able to get custom attributes. How to get custom attributes from a okta user using Okta Client Java SDK?
Juan Pablo VelazquezJuan Pablo Velazquez
You can acces the custom attributes using the user profile, after this the attribute reside in a Map object and is accessed using getUnmapped(), here is an example:

UserProfile uProfile = user.getProfile();
String customAttrib = (String)uProfile.getUnmapped().get("myatribute");

regards
Juan Pablo Velazquez

 
Okta AgentOkta Agent
Thanks. How do I do this in Python?
Rajesh KumarRajesh Kumar (Okta, Inc.)
 I am writing a custom code and need to pull custom attribute from the user profile and update it.

I was trying to use the above line of code as in my custom code but I observed that getUnmapped() method is no longer part of the API.

Here is the reference URL for API - https://developer.okta.com/okta-sdk-java/apidocs/