接口 AuthPluginService


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

      • identityNames

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

        boolean enableAuth​(ActionTypes action,
                           java.lang.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
        返回:
      • validateIdentity

        boolean 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
        返回:
        true if legal, otherwise false
        抛出:
        AccessException - if authentication is failed
      • validateAuthority

        java.lang.Boolean 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.
        返回:
        Boolean if the user has the resource authority.
        抛出:
        AccessException - if authentication is failed
      • getAuthServiceName

        java.lang.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