<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
0D54z00008takueCAAOkta Classic EngineDirectoriesAnswered2024-12-09T09:00:20.000Z2023-03-09T15:32:02.000Z2023-08-16T18:40:11.000Z

sdipm (sdipm) asked a question.

How to update custom attribute available in Custom user Type

HI,

I have custom user type Agent and it has 5 base attributes and 1 custom attribute.

FName, LName,Address,Phone, ZipCode - Base attribute

 

agentId - Custom Attribute

 

The default OKTA user profile has only 5 base attributes. The default user profile does not have agentId custom attribute.

 

Now i want to update the agentId value from Update API, getting error "Property name 'agentId' is not defined in profile"

 

Request

{"profile": { "agentId": "5ced5255-bac4-423c-acf8-212e8f8877ee"}}

 

Please help how to update it.


  • User16594883467582706479 (Customer Support Online Experience)

    Hi, @sdipm (sdipm)​ 

     

    Thank you for posting on our Community page!

     

    You need to add the custom attributes in the Okta profile and then you can update the user profile using the Update API following the below documentation:

     

    Thank you for reaching out to our Community and have a great day!

     

    _____________________________________________________________________________

    Community members help others by clicking Like or Select as Best on responses. Try it today.

    _____________________________________________________________________________

    Expand Post
  • TimL.58332 (Workflows)

    @sdipm (sdipm)​  - Hello. Based on the action the Okta Admin UI takes when you modify the profile of a user set to the non-default userType it is a PUT operation. This is considered "strict" and requires all attribute values be populated. Any non-populated values will be nulled/emptied out.

     

    See: https://developer.okta.com/docs/reference/api/users/#update-user

     

    Additionally, since it is an custom Okta userType you must include the "type" property in the object which contains the ID of the custom userType.

     

    Here is an example payload that only contains the 4 base required profile attributes.

     

     

    {

     "profile": {

      "email": "userType.testUser@tlaborn.com",

      "firstName": "userType",

      "login": "userType.testUser@tlaborn.com",

      "lastName": "testUser"

     },

     "type": {

      "id": "oty4wl4rw58G1LiUU5d7"

     }

    }

    Expand Post
  • sdipm (sdipm)

    I found the answer, as long as custom attribute is part of any user type, update API will update the value.

    Each profile in OKTA needs to be the part of any User type. In my case one of the user was under default Okta user type and default Okta Profile does not had the custom attribute. When I changes the type, I was able to update the custom attribute. The. thread can be closed.

    Expand Post
    • Can you explain this in a little more detail. I believe I am having a similar issue where I am attempting to update user profiles via an API call but they don't contain the attributes I am trying to update so it fails. If I manually modify the profile in the UI and add a dummy value I am then able to update via the API. I just don't understand about user types and if there is a way to change them in the UI or not.

      Expand Post
      • sdipm (sdipm)

        First check your attribute, is it custom or default attribute
        If its custom then go to Profile editor and search you app name(created in Applications) in Profile editor. You will see one profile with the name <your application name> User.
        Open that and add your custom attribute(e.g GUID) in that profile type.
        Also create new custom profile(e.g. Agent_profile) and keep all the attributes same as default user and add your custom attribute(e.g GUID) here too.
        After that in the same open profile window, you will see Mapping button, you will see list of Profile type and pick the profile that matches with your profile created above(e.g. Agent_Profile)
        When you are in mapping window you will see 2 tabs, mapping from your <application name> to Custom profile(e.g. Agent_profile) or vice versa.
        Select custom profile(e.g. Agent_Profile) to <application name>

        Follow the steps as per the attached screens shot.

        In your SAML application , add custom attribute. And add variable name as appuser.<custom attribute name>


        I hope this help
        Expand Post
This question is closed.
Loading
How to update custom attribute available in Custom user Type