I'm using OpenAM v11. And configure OAuth2.0 for openAM authentication module. I enable dynamic account creation of not exist'. Everything work fine, account attributes from OAuth providers are populated to OpenAM account. But not the uid.
Those dynamic created ac will have random generated UID and according to the manual: Create account if it does not exist This option must be enabled for this use case. In this case if the user does not exist, the account will be created on the fly. The account will have a uid that is dynamically created as a UUID and the attributes of the profile will be the ones configured in the attribute mapper configuration.
Is that a way for me to customize the user creation rule or just a UI configuration allow me to map attribute value from OAuth provider (e.g. login id or email) to be used for OpenAM new account UID / UUID ?
Thanks
Yes, you can implement a custom AccountMapper implementation and in the #provisionUser method you just have to figure out what the username should be based on the received attributes. In the OAuth 2.0 auth module configuration you just have to configure the Account Mapper setting to point your custom impl and it should work.