|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.dyuproject.oauth.sp.HashStore
public abstract class HashStore
The hashed tokens are generated and parsed using encryption and mac signatures.
Field Summary | |
---|---|
static long |
DEFAULT_ACCESS_TIMEOUT
the default access timeout (60*60*1000 or the defined property "hashstore.access_timeout") |
static long |
DEFAULT_EXCHANGE_TIMEOUT
the default exchange timeout (60*10*1000 or the defined property "hashstore.exchange_timeout") |
static long |
DEFAULT_LOGIN_TIMEOUT
the default login timeout ( DEFAULT_EXCHANGE_TIMEOUT /2 or
the defined property "hashstore.login_timeout") |
static String |
DEFAULT_MAC_ALGORITHM
the default mac algorithm ("HMACSHA1") |
Constructor Summary | |
---|---|
HashStore(String secretKey,
String macSecretKey)
|
|
HashStore(String secretKey,
String macSecretKey,
String macAlgorithm,
long accessTimeout,
long exchangeTimeout,
long loginTimeout)
|
Method Summary | |
---|---|
ServiceToken |
generateToken(String consumerKey,
String consumerSecret,
String id)
|
ServiceToken |
getAccessToken(String consumerKey,
String accessToken)
Gets the access token to be verified by the caller; Returns null if the access token is invalid. |
String |
getAuthCallbackOrVerifier(String requestToken,
String id)
Gets the auth callback or verifier; This could either be the url with oauth_token and oauth_verifier params, or the verifier "oob". |
protected abstract String |
getConsumerSecret(String consumerKey)
|
ServiceToken |
getRequestToken(String consumerKey,
String requestToken)
Gets the request token with secret to be verified by the caller; Returns null if the request token is invalid. |
ServiceToken |
newAccessToken(String consumerKey,
String verifier,
String requestToken)
Generates a new access token that is basically exchanged from the given requestToken ; Returns null if the requestToken is invalid. |
ServiceToken |
newAccessToken(String consumerKey,
String verifier,
String requestToken,
ServiceToken verifiedRequestToken)
Generates a new access token that is basically exchanged from the given requestToken ; Returns null if the requestToken is invalid. |
ServiceToken |
newHybridRequestToken(String consumerKey,
String id)
Particularly useful for hybrid openid+oauth; The underlying implementation will loosen the validation/verification since openid authentication is being used. |
ServiceToken |
newRequestToken(String consumerKey,
String callback)
Generates a new request token to be used by the caller to write a response. |
protected String |
validateCallbackUrl(String callbackUrl)
|
static String |
validateUrl(String url)
Returns null if the given url is invalid; This is a utility method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long DEFAULT_ACCESS_TIMEOUT
public static final long DEFAULT_EXCHANGE_TIMEOUT
public static final long DEFAULT_LOGIN_TIMEOUT
DEFAULT_EXCHANGE_TIMEOUT
/2 or
the defined property "hashstore.login_timeout")
public static final String DEFAULT_MAC_ALGORITHM
Constructor Detail |
---|
public HashStore(String secretKey, String macSecretKey)
public HashStore(String secretKey, String macSecretKey, String macAlgorithm, long accessTimeout, long exchangeTimeout, long loginTimeout)
Method Detail |
---|
public final ServiceToken newRequestToken(String consumerKey, String callback)
ServiceToken.Store
consumerKey
and callback
.
newRequestToken
in interface ServiceToken.Store
public final ServiceToken getRequestToken(String consumerKey, String requestToken)
newHybridRequestToken(String, String)
,
the token will be identified and a different request token will be returned that
is not associated with a secret key since we are relying on the security of the
openid protocol.
getRequestToken
in interface ServiceToken.Store
public final String getAuthCallbackOrVerifier(String requestToken, String id)
ServiceToken.Store
getAuthCallbackOrVerifier
in interface ServiceToken.Store
public final ServiceToken newHybridRequestToken(String consumerKey, String id)
ServiceToken.Store
newHybridRequestToken
in interface ServiceToken.Store
public final ServiceToken generateToken(String consumerKey, String consumerSecret, String id)
public final ServiceToken newAccessToken(String consumerKey, String verifier, String requestToken)
ServiceToken.Store
requestToken
; Returns null if the requestToken
is invalid.
newAccessToken
in interface ServiceToken.Store
public final ServiceToken newAccessToken(String consumerKey, String verifier, String requestToken, ServiceToken verifiedRequestToken)
ServiceToken.Store
requestToken
; Returns null if the requestToken
is invalid.
The param verifiedRequestToken
is the service token recently obtained
from ServiceToken.Store.getRequestToken(String, String)
. That is to use the consumerSecret
linked to the same consumerKey to avoid another lookup.
This method is added for efficiency..
newAccessToken
in interface ServiceToken.Store
public final ServiceToken getAccessToken(String consumerKey, String accessToken)
ServiceToken.Store
getAccessToken
in interface ServiceToken.Store
protected abstract String getConsumerSecret(String consumerKey)
protected String validateCallbackUrl(String callbackUrl)
public static String validateUrl(String url)
url
is invalid; This is a utility method.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |