Class JwtBearerTokenAuthenticationConverter

  • All Implemented Interfaces:
    org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,​org.springframework.security.authentication.AbstractAuthenticationToken>

    public final class JwtBearerTokenAuthenticationConverter
    extends java.lang.Object
    implements org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,​org.springframework.security.authentication.AbstractAuthenticationToken>
    A Converter that takes a Jwt and converts it into a BearerTokenAuthentication. In the process, it will attempt to parse either the "scope" or "scp" attribute, whichever it finds first. It's not intended that this implementation be configured since it is simply an adapter. If you are using, for example, a custom JwtGrantedAuthoritiesConverter, then it's recommended that you simply create your own Converter that delegates to your custom JwtGrantedAuthoritiesConverter and instantiates the appropriate BearerTokenAuthentication.
    Since:
    5.2
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.springframework.security.authentication.AbstractAuthenticationToken convert​(org.springframework.security.oauth2.jwt.Jwt jwt)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.springframework.core.convert.converter.Converter

        andThen
    • Constructor Detail

      • JwtBearerTokenAuthenticationConverter

        public JwtBearerTokenAuthenticationConverter()
    • Method Detail

      • convert

        public org.springframework.security.authentication.AbstractAuthenticationToken convert​(org.springframework.security.oauth2.jwt.Jwt jwt)
        Specified by:
        convert in interface org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,​org.springframework.security.authentication.AbstractAuthenticationToken>