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
ATokenStrategy
that is aware of theOAuthIdentity
of the authorizing user.- Since:
- 3.3.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OAuthIdentity
getOAuthIdentity(String oauthToken)
Gets theOAuthIdentity
associated with an access/request token.OAuthIdentity
getTwoLeggedOAuthIdentity(String consumerKey)
Gets theOAuthIdentity
mapped to a consumer key by thesetTwoLeggedOAuthIdentity(String, OAuthIdentity)
method.void
removeTwoLeggedOAuthIdentity(String consumerKey)
Removes theOAuthIdentity
mapped to a consumer key by thesetTwoLeggedOAuthIdentity(String, OAuthIdentity)
method.void
setTwoLeggedOAuthIdentity(String consumerKey, OAuthIdentity identity)
Convenient method to associate anOAuthIdentity
with 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 theOAuthIdentity
associated 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,
null
otherwise.
-
setTwoLeggedOAuthIdentity
void setTwoLeggedOAuthIdentity(String consumerKey, OAuthIdentity identity)
Convenient method to associate anOAuthIdentity
with 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 theOAuthIdentity
of the corresponding functional user once is resolved; subsequent requests can call then thegetTwoLeggedOAuthIdentity(String)
method to get theOAuthIdentity
of 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 theOAuthIdentity
mapped 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
OAuthIdentity
if mapped;null
otherwise.
-
removeTwoLeggedOAuthIdentity
void removeTwoLeggedOAuthIdentity(String consumerKey)
Removes theOAuthIdentity
mapped to a consumer key by thesetTwoLeggedOAuthIdentity(String, OAuthIdentity)
method.- Parameters:
consumerKey
- the consumer key.
-
-