Open vfraga opened 4 months ago
The fix is not straightforward and solution may have higher complexity.
The following considerations should be taken into account:
Potential solution: Perform the local user associations and resolving user claims, which currently happens post JIT provisioning authentication, after the authentication flow is successfully completed. These claims and the associated local user are required for MFA authentication scenarios.
[1]. https://github.com/wso2-extensions/identity-event-handler-notification/pull/238
Describe the issue: We've noticed that the 'locale' claim is not honoured in the Email OTP flow for federated users even if the claim was provided (present in the IdP response or set in the SP adaptive script).
Additionally, when we enabled JIT provisioning and ticked on the 'Assert identity using mapped local subject identifier' checkbox, the output was the same even if the associated local user had a value for the Locality claim (http://wso2.org/claims/locality).
Further investigation revealed that we're only trying to retrieve the user attributes from the user store using the username and user store domain shared in the event properties [1][2], which would only work if we passed the username and user store domain from the associated local user when creating the event [3].
We attempted to overcome this limitation by trying different things in the adaptive scripts (e.g., setting the remote/local claim value or changing the subject name to the same as the local user's) with no success.
I think we should allow the retrieval of federated user data since some IdPs can provide their language preferences in their response [4] or the use of the attribute values from the associated local user.
How to reproduce:
Expected behavior: The emails or SMS sent triggered by a federated authentication flow should honour the user's locale.
Environment information: