接口 AuthPluginService


public interface AuthPluginService
Auth service.
作者:
Wuyfee, xiweng.yy
  • 方法详细资料

    • identityNames

      Collection<String> identityNames()
      Define which identity information needed from request. e.q: username, password, accessToken.
      返回:
      identity names
    • enableAuth

      boolean enableAuth(ActionTypes action, String type)
      Judgement whether this plugin enable auth for this action and type.
      参数:
      action - action of request, see ActionTypes
      type - type of request, see SignType
      返回:
      @return true if enable auth, otherwise false
    • validateIdentity

      AuthResult validateIdentity(IdentityContext identityContext, Resource resource) throws AccessException
      To validate whether the identity context from request is legal or illegal.
      参数:
      identityContext - where we can find the user information
      resource - resource about this user information
      返回:
      AuthResult of validate result
      抛出:
      AccessException - if authentication is failed
    • validateAuthority

      AuthResult validateAuthority(IdentityContext identityContext, Permission permission) throws AccessException
      Validate the identity whether has the resource authority.
      参数:
      identityContext - where we can find the user information.
      permission - permission to auth.
      返回:
      AuthResult of validate result
      抛出:
      AccessException - if authentication is failed
    • getAuthServiceName

      String getAuthServiceName()
      AuthPluginService Name which for conveniently find AuthPluginService instance.
      返回:
      AuthServiceName mark a AuthPluginService instance.
    • isLoginEnabled

      default boolean isLoginEnabled()
      Is the plugin enable login.
      返回:
      true if plugin need login, otherwise false
      从以下版本开始:
      2.2.2
    • isAdminRequest

      default boolean isAdminRequest()
      Whether need administrator .
      返回:
      if need the administrator role.