All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.lsn.spring.auth.service.UserProvider Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version
package io.lsn.spring.auth.service;

import io.lsn.spring.auth.entity.User;

/**
 * @author Patryk Szlagowski 
 */
public interface UserProvider {

    /**
     * get user by generated api token
     *
     * @param token
     * @return
     * @throws Exception
     */
    User findByApiToken(String token) throws Exception;

    /**
     * get user by username
     *
     * @param username username (login)
     * @return
     */
    User findByUsername(String username) throws Exception;


    /**
     * invalidate token
     *
     * @param user
     */
    void terminateApiToken(User user) throws Exception;

    /**
     * authenticate user
     *
     * @param user     user entity
     * @param password password for the user
     * @throws Exception
     */
    void authenticate(User user, String password) throws Exception;

    /**
     * create new api token for user
     *
     * @param user
     */
    void assignNewApiToken(User user) throws Exception;

    /**
     * extend the existing api token
     *
     * @param user
     * @throws Exception
     */
    void extendExistingApiToken(User user) throws Exception;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy