|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TokenStrategy
Manages and validates OAuth tokens and token secrets.
SimpleTokenStrategy
is a basic implementation, but you can implement
this interface to generate and validate OAuth tokens your own way.
Method Summary | |
---|---|
void |
generateAccessToken(OAuthRequest oAuthRequest)
Generates an access token and token secret and sets it in the accessor in the OAuthRequest . |
void |
generateRequestToken(OAuthRequest oAuthRequest)
Generates a request token and token secret and sets it in the accessor in the OAuthRequest . |
String |
generateVerificationCode(javax.servlet.http.HttpServletRequest httpRequest,
String requestToken)
Generates an "unguessable" OAuth verification code. |
String |
getCallback(javax.servlet.http.HttpServletRequest httpRequest,
String requestToken)
Gets the OAuth callback associated with this consumer for OAuth 1.0a authentication flows. |
String |
getTokenSecret(javax.servlet.http.HttpServletRequest httpRequest,
String token)
Gets the token secret for token to validate signatures. |
boolean |
isRequestTokenAuthorized(javax.servlet.http.HttpServletRequest httpRequest,
String requestToken)
Checks with the request token has been authorized by the end user. |
void |
markRequestTokenAuthorized(javax.servlet.http.HttpServletRequest httpRequest,
String requestToken)
Indicates that a user has typed in a valid ID and password, and that the request token can now be exchanged for an access token. |
void |
validateAccessToken(OAuthRequest oAuthRequest)
Validates that the access token is valid, throwing an exception if not. |
String |
validateRequestToken(javax.servlet.http.HttpServletRequest httpRequest,
net.oauth.OAuthMessage message)
Validates that the request token is valid, throwing an exception if not. |
void |
validateVerificationCode(OAuthRequest oAuthRequest)
Validates that the verification code is recognized and associated with the request token. |
Method Detail |
---|
void generateRequestToken(OAuthRequest oAuthRequest) throws net.oauth.OAuthException, IOException
OAuthRequest
.
oAuthRequest
- the OAuth request
IOException
- on errors reading from the request message
net.oauth.OAuthException
- on OAuth problemsOAuthRequest.getAccessor()
String validateRequestToken(javax.servlet.http.HttpServletRequest httpRequest, net.oauth.OAuthMessage message) throws net.oauth.OAuthException, IOException
httpRequest
- the HTTP requestmessage
- the OAuth message
net.oauth.OAuthException
- if the tokens are not valid
IOException
- on I/O errorsString getCallback(javax.servlet.http.HttpServletRequest httpRequest, String requestToken) throws net.oauth.OAuthException
httpRequest
- the HTTP requestrequestToken
- the request token
net.oauth.OAuthException
- on OAuth problemsvoid markRequestTokenAuthorized(javax.servlet.http.HttpServletRequest httpRequest, String requestToken) throws net.oauth.OAuthException
httpRequest
- the servlet requestrequestToken
- the request token string
net.oauth.OAuthException
- if the token is not validisRequestTokenAuthorized(HttpServletRequest, String)
boolean isRequestTokenAuthorized(javax.servlet.http.HttpServletRequest httpRequest, String requestToken) throws net.oauth.OAuthException
httpRequest
- the servlet requestrequestToken
- the request token
net.oauth.OAuthException
- on OAuth problems#markRequestTokenAuthorized(HttpServletRequest, OAuthAccessor)
String generateVerificationCode(javax.servlet.http.HttpServletRequest httpRequest, String requestToken) throws net.oauth.OAuthException
httpRequest
- the HTTP requestrequestToken
- the request token
net.oauth.OAuthException
- on OAuth problems (e.g., the request token is invalid)void validateVerificationCode(OAuthRequest oAuthRequest) throws net.oauth.OAuthException, IOException
oAuthRequest
- the OAuth request
net.oauth.OAuthException
- on OAuth problems (e.g., the request token is invalid)
IOException
- on I/O errorsvoid generateAccessToken(OAuthRequest oAuthRequest) throws net.oauth.OAuthException, IOException
OAuthRequest
. Clears any request tokens set.
oAuthRequest
- the OAuth request
net.oauth.OAuthException
- on OAuth problems
IOException
- on I/O errorsOAuthRequest.getAccessor()
void validateAccessToken(OAuthRequest oAuthRequest) throws net.oauth.OAuthException, IOException
oAuthRequest
- the OAuth request
net.oauth.OAuthException
- if the token is invalid
IOException
- on I/O errorsString getTokenSecret(javax.servlet.http.HttpServletRequest httpRequest, String token) throws net.oauth.OAuthException
httpRequest
- the HTTP requesttoken
- the token string, either a request token or access token
net.oauth.OAuthException
- on OAuth problems (e.g., the token is invalid)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |