类 HttpServletAuthService

java.lang.Object
tech.riemann.etp.auth.service.HttpServletAuthService
所有已实现的接口:
AuthService
直接已知子类:
DefaultAuthService

public abstract class HttpServletAuthService extends Object implements AuthService
作者:
Kerbores(kerbores@riemann.tech)
  • 字段详细资料

  • 构造器详细资料

    • HttpServletAuthService

      public HttpServletAuthService()
  • 方法详细资料

    • getRequest

      public abstract jakarta.servlet.http.HttpServletRequest getRequest()
    • getResponse

      public abstract jakarta.servlet.http.HttpServletResponse getResponse()
    • userDetailService

      public abstract UserDetailService userDetailService()
    • jwtEncoder

      public abstract JWTEncoder jwtEncoder()
    • jwtDecoder

      public abstract JWTDecoder jwtDecoder()
    • cookieSettings

      public CookieSettings cookieSettings()
      cookie 设置
      返回:
    • subject

      public String subject(String token)
      从接口复制的说明: AuthService
      根据token获取subject信息
      指定者:
      subject 在接口中 AuthService
      参数:
      token -
      返回:
    • token

      public String token(String subject)
      从接口复制的说明: AuthService
      生成token
      指定者:
      token 在接口中 AuthService
      参数:
      subject -
      返回:
    • refreshToken

      public String refreshToken(String subject)
      从接口复制的说明: AuthService
      生成refreshToken
      指定者:
      refreshToken 在接口中 AuthService
      参数:
      subject -
      返回:
    • login

      public AuthUser login(AuthUser user)
      用户登录
      指定者:
      login 在接口中 AuthService
      参数:
      user -
    • logout

      public void logout()
      登出
      指定者:
      logout 在接口中 AuthService
    • user

      public AuthUser user()
      获取当前登录用户
      指定者:
      user 在接口中 AuthService
      返回:
    • userName

      public String userName()
      从接口复制的说明: AuthService
      获取用户名
      指定者:
      userName 在接口中 AuthService
      返回:
    • tryRefreshToken

      public AuthUser tryRefreshToken(String refreshToken)
      参数:
      refreshToken -
      返回:
    • addCookie

      public void addCookie(String name, String value, int age)
      添加cookie
      参数:
      name - 名称
      value - 值
      age - 有效期(分钟)
    • authentication

      public boolean authentication(List<String> withoutAuthenticationUrlRegulars)
      认证检查
      指定者:
      authentication 在接口中 AuthService
      参数:
      withoutAuthenticationUrlRegulars - 不需要检查的url正则表达式
      返回:
      认证检查通过状态
    • pass

      public boolean pass(String uri, List<String> withoutAuthenticationUrlRegulars)
      参数:
      uri - 请求地址
      withoutAuthenticationUrlRegulars - 放行url正则
      返回:
      是否放行
    • skip

      public boolean skip()
      是否跳过检查
      返回:
    • authorizationHeaderKey

      public String authorizationHeaderKey()
      认证头key
      返回:
    • tokenKey

      public String tokenKey()
      token key ,可以接受从header/cookie和请求参数传入
      返回:
    • refreshTokenKey

      public String refreshTokenKey()
      refresh token key ,可以接受从header/cookie和请求参数传入
      返回:
    • token

      public String token()
      获取token
      指定者:
      token 在接口中 AuthService
      返回:
    • refreshToken

      public String refreshToken()
      获取 refresh token
      指定者:
      refreshToken 在接口中 AuthService
      返回:
    • optionalUser

      public Optional<AuthUser> optionalUser()
      从接口复制的说明: AuthService
      尝试获取当前用户
      指定者:
      optionalUser 在接口中 AuthService
      返回:
      另请参阅:
      • 引用无效
        club.zhcs.lina.auth.service.AuthService#optionalUser()