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

com.yammer.dropwizard.auth.Authenticator Maven / Gradle / Ivy

There is a newer version: 0.6.2
Show newest version
package com.yammer.dropwizard.auth;

import com.google.common.base.Optional;

/**
 * An interface for classes which authenticate user-provided credentials and return principal
 * objects.
 *
 * @param     the type of credentials the authenticator can authenticate
 * @param 

the type of principals the authenticator returns */ public interface Authenticator { /** * Given a set of user-provided credentials, return an optional principal. * *

If the credentials are valid and map to a principal, returns an {@code Optional.of(p)}.

* *

If the credentials are invalid, returns an {@code Optional.absent()}.

* * @param credentials a set of user-provided credentials * @return either an authenticated principal or an absent optional * @throws AuthenticationException if the credentials cannot be authenticated due to an * underlying error */ Optional

authenticate(C credentials) throws AuthenticationException; }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy