public class SigUtils
extends java.lang.Object
| Constructor and Description |
|---|
SigUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
calcOAuth1BaseString(java.lang.String httpMethod,
java.lang.String url,
GSRequest request) |
static java.lang.String |
getDynamicSessionSignature(java.lang.String glt_cookie,
int timeoutInSeconds,
java.lang.String secret)
This is a utility method for generating the cookie value of a dynamic session expiration cookie.
|
static java.lang.String |
getOAuth1Signature(java.lang.String baseString,
java.lang.String secret) |
static boolean |
validateFriendSignature(java.lang.String UID,
java.lang.String timestamp,
java.lang.String friendUID,
java.lang.String secret,
java.lang.String signature)
Use this method to verify the authenticity of a socialize.getFriendsInfo API method response, to make sure it is in fact originating from Gigya, and prevent fraud.
|
static boolean |
validateUserSignature(java.lang.String UID,
java.lang.String timestamp,
java.lang.String secret,
java.lang.String signature)
Use this method to verify the authenticity of a socialize.getUserInfo API method response, to make sure it is in fact originating from Gigya, and prevent fraud.
|
public static boolean validateUserSignature(java.lang.String UID,
java.lang.String timestamp,
java.lang.String secret,
java.lang.String signature)
throws java.security.InvalidKeyException,
java.io.UnsupportedEncodingException
UID - pass the UID field returned by the "socialize.getUserInfo" API method responsetimestamp - pass the signatureTimestamp field returned by the "socialize.getUserInfo" API method responsesecret - your partner's "Secret Key", obtained from Gigya's website.signature - pass the UIDSignature field returned by the "socialize.getUserInfo" API method responsejava.security.InvalidKeyExceptionjava.io.UnsupportedEncodingExceptionpublic static boolean validateFriendSignature(java.lang.String UID,
java.lang.String timestamp,
java.lang.String friendUID,
java.lang.String secret,
java.lang.String signature)
throws java.security.InvalidKeyException,
java.io.UnsupportedEncodingException
UID - pass the UID field returned by the "socialize.getFriendsInfo" API method responsetimestamp - pass the signatureTimestamp field returned by the "socialize.getFriendsInfo" API method responsesecret - your partner's "Secret Key", obtained from Gigya's website.signature - pass the friendshipSignature field returned by the "socialize.getFriendsInfo" API method responsejava.security.InvalidKeyExceptionjava.io.UnsupportedEncodingExceptionpublic static java.lang.String getOAuth1Signature(java.lang.String baseString,
java.lang.String secret)
throws java.security.InvalidKeyException,
java.net.MalformedURLException,
java.io.UnsupportedEncodingException
java.security.InvalidKeyExceptionjava.net.MalformedURLExceptionjava.io.UnsupportedEncodingExceptionpublic static java.lang.String calcOAuth1BaseString(java.lang.String httpMethod,
java.lang.String url,
GSRequest request)
throws java.net.MalformedURLException,
java.io.UnsupportedEncodingException
java.net.MalformedURLExceptionjava.io.UnsupportedEncodingExceptionpublic static java.lang.String getDynamicSessionSignature(java.lang.String glt_cookie,
int timeoutInSeconds,
java.lang.String secret)
throws java.security.InvalidKeyException,
java.io.UnsupportedEncodingException
glt_cookie - the login token received from Gigya after successful Login. Gigya stores the token in a cookie named: "glt_" + [Your API Key]timeoutInSeconds - how many seconds until session expiration. For example, if you would like the session to expire in 5 minutes set this parameter to 300.secret - your Gigya "Secret Key", is provided, in BASE64 encoding, at the bottom of the Dashboard page on the Gigya's website.java.security.InvalidKeyExceptionjava.io.UnsupportedEncodingException