Passer au contenu

Update user profile in identity store

1

EDIT: SOLVED

With a bit of trial and error I was able to solve it.

The attributepath strings I had to use were name.givenName , name.familyName and displayName

For example:

{
    "IdentityStoreId": "d-XXXXXXXXXXX",
    "UserId": "uid",
    "Operations": [
        {
            "AttributePath": "name.givenName",
            "AttributeValue": "MyGivenName"
        }
    ]
}

I wish the documentation was a bit more clear about the alternative when shorthand syntax can't be used.

Hi,

Similar question to: https://repost.aws/questions/QU6QhgdzQUQ_6yLMXxRz_Pxg/update-user-in-identity-store

We've connected our IAM Identity Center to Okta.

I'm trying to update the given name and family name fields for a user in IAM Identity Center via cli. Having a bit of trouble understanding what's expected in the attributepath and attributevalue.

After tinkering with the JSON file a bit I got to the below, but receive an error.

{
    "IdentityStoreId": "d-XXXXXXXXX",
    "UserId": "uid",
    "Operations": [
        {
            "AttributePath": "name",
            "AttributeValue": [{
                "FamilyName": "VVV",
                "GivenName": "YYY"
            }]
        }
    ]
}

Error is:

An error occurred (ValidationException) when calling the UpdateUser operation: name: The attribute name should be type COMPLEX, not a list.

The cli command I'm running is

aws identitystore update-user --cli-input-json file://attributes.json  --profile profile-name

Any help will be appreiciated

Thanks, Elior.

1 réponse
0

On investigating the error received by you, I was able to confirm that the error "An error occurred (ValidationException) when calling the UpdateUser operation: name: The attribute name should be type COMPLEX, not a list." occurs if it is a syntax error. Kindly refer to the following documentation for the same:

[+] https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/API_UpdateUser.html 

I checked the json file being passed by you and found that the Attribute value parameter has a syntax error.

The following should be the correct syntax of the json file:


{ "IdentityStoreId": "d-XXXXXXXXX", "UserId": "uid", "Operations": [ { "AttributePath": "name", "AttributeValue": [ "FamilyName": "VVV", "GivenName": "YYY" ] } ] }

Kindly use the above json and execute the CLI command.

AWS

répondu il y a 3 ans

  • Thanks for looking into this. I'm not sure I understand the differences between the JSON syntax you provided to the one I initially posted.

    I did however find a solution (edited my original post), and the correct syntax for familyname for example is name.familyname.

    Thanks again, Elior.

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.