<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D50Z00008G7VPwSANOkta Classic EngineIntegrationsAnswered2024-05-03T19:59:51.000Z2016-02-17T20:44:46.000Z2017-07-26T00:16:33.000Z
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?

  • 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

     

    Expand Post
  • rajesh.kumar1.5065495040449814E12 (Emerging Product Acceleration)

    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/

    Expand Post
This question is closed.
Loading
How to get custom attributes of a user using Okta Client Java SDK API?