Class DefaultOpenIdAuthenticationMapper

java.lang.Object
io.micronaut.security.oauth2.endpoint.token.response.DefaultOpenIdAuthenticationMapper
All Implemented Interfaces:
OpenIdAuthenticationMapper

@Singleton @Requires(configuration="io.micronaut.security.token.jwt") public class DefaultOpenIdAuthenticationMapper extends Object implements OpenIdAuthenticationMapper
The default implementation of OpenIdAuthenticationMapper that uses the subject claim for the username and populates the attributes with the non JWT standard claims. If an OpenIdAuthenticationMapper bean is created with a named qualifier that is the same name of the provider, that bean will be used instead of this one.

The sub claim is only unique within the provider which issued it. When more than one enabled OAuth 2.0 client (other than client-credentials-only clients) is configured under micronaut.security.oauth2.clients, or when micronaut.security.oauth2.openid.qualify-username-with-provider is true, the username is qualified with the provider name as providerName:subject so that users of different providers who share a sub do not resolve to the same user. This is the same convention the UserInfo endpoint token validator uses. The unqualified subject remains available in the sub attribute. Note that with micronaut.security.authentication set to idtoken the ID token itself is the credential of later requests, so their username is the bare sub claim and is not qualified.

Since:
1.2.0
Author:
James Kleeh