I am using google as federated identity in aws cognito.
I have got the user created but I am not able to add the custom attributes, I have in the user pool. I am trying to add custom attributes using the console.
I don't see this custom attribute when I click on User and Groups -> Any of the user.
I also tried using the cognito pool as Idp ( alongwith Google ) but that also didn't change anything.
I have also tried creating user using this :
aws cognito-idp admin-create-user \
--profile stage \
--region ap-south-1 \
--user-pool-id SSO-Test-User-Pool \
--username test@test.com \
--user-attributes Name=email,Value=test@test.com Name=custom:custom:role,Value="cms.tv_admin" \
--message-action SUPPRESS
But it gives error :
An error occurred (InvalidParameterException) when calling the AdminCreateUser operation: 1 validation error detected: Value 'SSO-Test-User-Pool' at 'userPoolId' failed to satisfy constraint: Member must satisfy regular expression pattern: [\w-]+_[0-9a-zA-Z]+
and same goes while I tried updating attributes using this :
aws cognito-idp admin-update-user-attributes \
--profile stage \
--region ap-south-1 \
--user-pool-id SSO-Test-User-Pool \
--username Google_113423776936123400493 \
--user-attributes Name=custom:custom:role,Value=admin
Further I found that these commands can be run using the app and that they need to have the code returned after logging in, which they would get using the redirect URI, I suppose.
How do I use that from the CLI ?
I have the readable and writable attributes set on the custom property by the app in the App Client Settings.
Thanks.
Let me know if more info is required.