com.clouway.oauth2.token.Tokens Maven / Gradle / Ivy
package com.clouway.oauth2.token;
import com.google.common.base.Optional;
import java.util.Date;
/**
* Tokens is responsible for issuing and retriving of issued tokens.
*
* @author Ivan Stefanov
*/
public interface Tokens {
/**
* Find token which is not expired till the provided time.
*
* @param token then token for which is looked
* @return an optional token value or absent value if not present
*/
Optional getNotExpiredToken(String token, Date when);
/**
* Refreshes token using the access token.
*
* @param token the access token
* @return the refreshed token
*/
Optional refreshToken(String token, Date when);
/**
* Ussues a new token for the provided identity.
* @param identityId the identityId for which token was issued
* @param when the requested time on which it should be issued
* @return
*/
Token issueToken(String identityId, Date when);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy