Class IamJwtAuthenticationConverter

java.lang.Object
com.chaosguide.iam.vertex.jwt.IamJwtAuthenticationConverter
All Implemented Interfaces:
org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt, org.springframework.security.authentication.AbstractAuthenticationToken>

public class IamJwtAuthenticationConverter extends Object implements org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt, org.springframework.security.authentication.AbstractAuthenticationToken>
把 IAM 签发的 Jwt 转成 Spring Security 使用的 JwtAuthenticationToken。

最终 authorities 来自两部分:

注意:这里不会读取、信任或合并 JWT 里的 permissions claim。权限必须运行时解析,避免 token 过大以及权限撤销延迟。

  • Constructor Details

  • Method Details

    • 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>