Interface UserSourceProfile

    • Field Detail

      • PWD_EXPIRATION_BYPASS

        static final Property<java.lang.String> PWD_EXPIRATION_BYPASS
        Bypass flag for auth requests that should not respect the password expiration setting of a user source. Used to verify a user's existing password during the reset phase.
    • Method Detail

      • getProfileId

        long getProfileId()
        The ID of this user profile
      • getName

        java.lang.String getName()
        The name of this user profile.
      • getCacheValidationTimeout

        long getCacheValidationTimeout()
        The cache update time-out option.
      • authenticate

        @Nullable
        AuthenticatedUser authenticate​(AuthChallenge challenge)
                                throws java.lang.Exception
        Called to both verify authentication for a given username/password pair, and to find the security roles for that user.
        Returns:
        An AuthenticatedUser that contains the user's roles if authentication succeeded, or null if it did not.
        Throws:
        java.lang.Exception
      • startup

        void startup​(UserSourceManager manager)
        Called when the user source is created before it is used.
      • shutdown

        void shutdown()
        Called either when the user source has been edited and so it is being restarted, or when the gateway is shutting down.
      • getUsers

        @Nonnull
        java.util.Collection<User> getUsers()
                                     throws java.lang.Exception
        Retrieve all users from this profile. This can execute slowly (block) if need be. It will be called periodically by the manager and the results will be cached.
        Throws:
        java.lang.Exception
      • getUser

        @Nonnull
        java.util.Optional<User> getUser​(java.lang.String userName)
                                  throws java.lang.Exception
        Fetch a User with the given user name. If more than one user exists with the given user name, the first user returned from the underlying data source is returned.
        Parameters:
        userName - the user name of the User to fetch
        Returns:
        an Optional User with the given user name
        Throws:
        java.lang.Exception - if there is an unexpected problem fetching the user with the given user name
      • getRoles

        @Nonnull
        java.util.Collection<java.lang.String> getRoles()
                                                 throws java.lang.Exception
        Returns:
        a collection of all possible role names for this profile. May be empty
        Throws:
        java.lang.Exception
      • validatePassword

        default java.lang.String validatePassword​(User user,
                                                  java.lang.String password)
        Validate the given password. Note that this doesn't mean it checks to see if this password matches the user's current password. Rather, it means that this password would be an acceptable new password for the user.
        Returns:
        A i18n key for the error message describing why the password is invalid, or null if the password is valid.
      • addRole

        void addRole​(java.lang.String roleName,
                     UICallback ui)
              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • removeRole

        void removeRole​(java.lang.String roleName,
                        UICallback ui)
                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • renameRole

        void renameRole​(java.lang.String oldName,
                        java.lang.String newName,
                        UICallback ui)
                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addUser

        void addUser​(User user,
                     UICallback ui)
              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • alterUser

        void alterUser​(User user,
                       UICallback ui)
                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • removeUser

        void removeUser​(User user,
                        UICallback ui)
                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • alterPassword

        void alterPassword​(User user,
                           java.lang.String oldPassword,
                           java.lang.String newPassword)
                    throws java.lang.Exception
        Throws:
        java.lang.Exception