views:

41

answers:

0

String requestUrl = AuthSubUtil.getRequestUrl(Constants.RETURN_URL,Constants.GOOGLE_DOCS_URL, false, true);

return "redirect:"+requestUrl;

After sign in using google account and grant access, it takes me to RETURN_URL with appened token but i am get invalid token like this

http://myurl?token=1/AIUEL-JKEA_KEIOI always starts with token=1/......

when i use this one time token to exchange with session token using

try {
            String onetimeUseToken = AuthSubUtil.getTokenFromReply(queryString);
            sessionToken = AuthSubUtil.exchangeForSessionToken(onetimeUseToken, null);
        }catch(Exception e){
            e.printStackTrace();
        }

i got AuthenticationException 403