Package com.sodius.oslc.server.oauth
Interface OAuthIdentityTokenStrategy
- All Superinterfaces:
org.eclipse.lyo.server.oauth.core.token.TokenStrategy
- All Known Implementing Classes:
ClusterableTokenStrategy
public interface OAuthIdentityTokenStrategy
extends org.eclipse.lyo.server.oauth.core.token.TokenStrategy
A
TokenStrategy that is aware of the OAuthIdentity of the authorizing user.- Since:
- 3.3.0
-
Method Summary
Modifier and TypeMethodDescriptiongetOAuthIdentity(String oauthToken) Gets theOAuthIdentityassociated with an access/request token.getTwoLeggedOAuthIdentity(String consumerKey) Gets theOAuthIdentitymapped to a consumer key by thesetTwoLeggedOAuthIdentity(String, OAuthIdentity)method.voidremoveTwoLeggedOAuthIdentity(String consumerKey) Removes theOAuthIdentitymapped to a consumer key by thesetTwoLeggedOAuthIdentity(String, OAuthIdentity)method.voidsetTwoLeggedOAuthIdentity(String consumerKey, OAuthIdentity identity) Convenient method to associate anOAuthIdentitywith a consumer after a two-legged authentication.Methods inherited from interface org.eclipse.lyo.server.oauth.core.token.TokenStrategy
generateAccessToken, generateRequestToken, generateVerificationCode, getCallback, getTokenSecret, isRequestTokenAuthorized, markRequestTokenAuthorized, validateAccessToken, validateRequestToken, validateVerificationCode
-
Method Details
-
getOAuthIdentity
Gets theOAuthIdentityassociated with an access/request token. Implementations must catch (and cache) this identity during theOAuth dance.- Parameters:
oauthToken- the access or request token key.- Returns:
- the associated identity if found,
nullotherwise.
-
setTwoLeggedOAuthIdentity
Convenient method to associate anOAuthIdentitywith a consumer after a two-legged authentication. Since no end-user is involved in two-legged authentication requests, this method allows associating the consumer with theOAuthIdentityof the corresponding functional user once is resolved; subsequent requests can call then thegetTwoLeggedOAuthIdentity(String)method to get theOAuthIdentityof the consumer without having to resolve it again.- Parameters:
consumerKey- the consumer key.identity- the identity of the consumer's functional user.
-
getTwoLeggedOAuthIdentity
Gets theOAuthIdentitymapped to a consumer key by thesetTwoLeggedOAuthIdentity(String, OAuthIdentity)method. This method will retrieve the identity until theremoveTwoLeggedOAuthIdentity(String)method is called or the map entry expires in the particular cache implementation.- Parameters:
consumerKey- the consumer key.- Returns:
- the corresponding
OAuthIdentityif mapped;nullotherwise.
-
removeTwoLeggedOAuthIdentity
Removes theOAuthIdentitymapped to a consumer key by thesetTwoLeggedOAuthIdentity(String, OAuthIdentity)method.- Parameters:
consumerKey- the consumer key.
-