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

net.anotheria.moskito.webui.auth.api.AuthApi Maven / Gradle / Ivy

There is a newer version: 4.0.3
Show newest version
package net.anotheria.moskito.webui.auth.api;

import net.anotheria.anoplass.api.API;
import net.anotheria.anoplass.api.APIException;
import net.anotheria.anoprise.metafactory.Service;

/**
 * Api provides functionality to decrypt and encrypt
 * user credentials data and check user existence.
 */
public interface AuthApi extends API, Service{

    /**
     * Encrypts user data bean using blowfish algorithm.
     * @param user user authorization data
     * @throws APIException on encryption fail
     * @return string represents encrypted user data
     */
    String encryptUserCredentials(UserAO user) throws APIException;

    /**
     * Check, does user with username and password from encrypted data
     * is noted in moskito webui configuration.
     * @param encryptedUserData user data encrypted by encryptUserCredentials(UserAO) method
     * @return true - config contains that user
     *         false - no
     */
    boolean userExists(String encryptedUserData) throws APIException;

    /**
     * Check, does user with username and password from user object in method parameter
     * is noted in moskito webui configuration.
     * @param user user data
     * @return true - config contains that user
     *         false - no
     */
    boolean userExists(UserAO user);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy