类 HttpServletAuthService

java.lang.Object
club.zhcs.lina.auth.service.HttpServletAuthService
所有已实现的接口:
AuthService
直接已知子类:
DefaultAuthService

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

    • HttpServletAuthService

      public HttpServletAuthService()
  • 方法详细资料

    • getRequest

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

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

      public abstract UserDetailService userDetailService()
    • jwtGenerator

      public abstract JWTGenerator jwtGenerator()
    • cookieSettings

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

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

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

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

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

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

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

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

      public AuthUser tryRefreshToken(String refreshToken)
      参数:
      refreshToken - refreshToken
      返回:
      AuthUser
    • 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
      返回:
      认证头key
    • tokenKey

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

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

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

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