com.clouway.oauth2.user.ResourceOwnerIdentityFinder Maven / Gradle / Ivy
package com.clouway.oauth2.user;
import com.clouway.friendlyserve.Request;
import com.clouway.oauth2.DateTime;
import com.google.common.base.Optional;
/**
* ResourceOwnerIdentityFinder is a finder which is used during the authorization of the request.
*
*
* In most cases implementations of this class should ask the session store for retrieving of the identity which is
* assicated with the request.
*
*
* @author Miroslav Genov ([email protected])
*/
public interface ResourceOwnerIdentityFinder {
/**
* Finds Identity of the caller.
*
* In most cases the request will contain a Cookie value which will be used
* as lookup key for the session of the Owner which contains and the requested identity.
*
* @param request the request from which identity will be retrieved
* @param instantTime the time on which request was executed
* @return an optional value with the identity id if it's associated with the provided request or absent value if not
*/
Optional find(Request request, DateTime instantTime);
}