Interface Authenticator<T>

Type Parameters:
T -
All Known Implementing Classes:
BootAuthenticator, LDAPAuthenticator

public interface Authenticator<T>
Author:
Changski Tie Zheng Zhang 张铁铮, 魏泽北, 杜旺财, 杜富贵
  • Field Details

    • GrpcCallerId

      static final io.grpc.Context.Key<String> GrpcCallerId
      gRPC JWT verification result
    • GrpcCaller

      static final io.grpc.Context.Key<Caller> GrpcCaller
      gRPC JWT verification result
  • Method Details

    • signJWT

      String signJWT(String username, String pwd, T metaData, int validForMinutes, ServiceContext context) throws NamingException
      Success HTTP Status: 201 Created
      Parameters:
      username -
      pwd -
      metaData -
      validForMinutes -
      context -
      Returns:
      JWT
      Throws:
      NamingException
    • signJWT

      String signJWT(Caller caller, int validForMinutes, ServiceContext context)
      Success HTTP Status: 201 Created
      Parameters:
      caller -
      validForMinutes -
      context -
      Returns:
    • toJwt

      io.jsonwebtoken.JwtBuilder toJwt(Caller caller, String txId)
      Convert Caller to auth token, override this method to implement customized token format
      Parameters:
      caller -
      txId -
      Returns:
      formatted auth token builder
    • verifyToken

      Caller verifyToken(io.netty.handler.codec.http.HttpHeaders httpRequestHeaders, AuthTokenCache cache, Integer errorCode, ServiceContext context)
      Success HTTP Status: 200 OK
      Parameters:
      httpRequestHeaders - contains Authorization = Bearer + JWT
      cache -
      errorCode -
      context -
      Returns:
      Caller
    • verifyToken

      Caller verifyToken(String authToken, AuthTokenCache cache, Integer errorCode, ServiceContext context)
      Parameters:
      authToken -
      cache -
      errorCode -
      context -
      Returns:
      Caller
    • customizedAuthorizationCheck

      boolean customizedAuthorizationCheck(RequestProcessor processor, io.netty.handler.codec.http.HttpHeaders httpRequestHeaders, String httpRequestPath, ServiceContext context) throws Exception
      Extra authorization checks before processing
      Parameters:
      processor -
      httpRequestHeaders -
      httpRequestPath -
      context -
      Returns:
      true if good to process request, otherwise false
      Throws:
      Exception
    • logoutToken

      void logoutToken(io.netty.handler.codec.http.HttpHeaders httpRequestHeaders, AuthTokenCache cache, ServiceContext context)
      Success HTTP Status: 204 No Content
      Parameters:
      httpRequestHeaders - contains Authorization = Bearer + JWT
      cache -
      context -
    • logoutToken

      void logoutToken(String authToken, AuthTokenCache cache, ServiceContext context)
      Success HTTP Status: 204 No Content
      Parameters:
      authToken -
      cache -
      context -