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.TokenStrategyATokenStrategythat is aware of theOAuthIdentityof the authorizing user.- Since:
- 3.3.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OAuthIdentitygetOAuthIdentity(String oauthToken)Gets theOAuthIdentityassociated with an access/request token.OAuthIdentitygetTwoLeggedOAuthIdentity(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 Detail
-
getOAuthIdentity
OAuthIdentity getOAuthIdentity(String oauthToken)
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
void setTwoLeggedOAuthIdentity(String consumerKey, OAuthIdentity identity)
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
OAuthIdentity getTwoLeggedOAuthIdentity(String consumerKey)
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
void removeTwoLeggedOAuthIdentity(String consumerKey)
Removes theOAuthIdentitymapped to a consumer key by thesetTwoLeggedOAuthIdentity(String, OAuthIdentity)method.- Parameters:
consumerKey- the consumer key.
-
-