Package org.encuestame.utils.oauth

Examples of org.encuestame.utils.oauth.OAuth1Token


     */
    public OAuth1Token getAccessToken(
            final String verifier,
            final WebRequest request) throws EnMeOAuthSecurityException{
        log.debug("Verifier "+verifier);
        final OAuth1Token accessToken = getoAuth1RestTemplate()
        .exchangeForAccessToken(new AuthorizedRequestToken(
                extractCachedRequestToken(request), verifier));
        return accessToken;
    }
View Full Code Here


     * @param request
     * @return
     */
    private OAuth1Token extractCachedRequestToken(
            WebRequest request) {
        OAuth1Token requestToken = (OAuth1Token) request
                .getAttribute(OAuthUtils.OAUTH_TOKEN_ATTRIBUTE, WebRequest.SCOPE_SESSION);
        request.removeAttribute(OAuthUtils.OAUTH_TOKEN_ATTRIBUTE, WebRequest.SCOPE_SESSION);
        log.debug("requestToken "+requestToken.toString());
        return requestToken;
    }
View Full Code Here

     * @throws EnMeNoResultsFoundException
     */
    @Test
    public void testisConnected() throws EnMeNoResultsFoundException{
        final UserAccount account = createUserAccount("jota", this.account);
        final OAuth1Token token = new OAuth1Token("token", "secret");
        //final AccountConnection ac = createConnection("TWITTER", token, "12345", account.getUid() , "ur");
        //final AccountConnection exAc = getAccountDao().getAccountConnection(ac.getUserAccout().getUid(), "TWITTER");
        //assertNotNull(exAc);
        //assertEquals("Should be equals", ac.getAccountConnectionId(), exAc.getAccountConnectionId());
//        final boolean conected = getAccountDao().isConnected(account.getUid(), "TWITTER");
View Full Code Here

     * @throws EnMeNoResultsFoundException
     */
    public OAuth1Token getAccessToken(String accountId, SocialProvider provider) throws EnMeNoResultsFoundException {
        final SocialAccount ac = this.getAccountConnection(accountId, provider);
        if (ac != null) {
            final OAuth1Token oAuthToken = new OAuth1Token(ac.getAccessToken(),
                    ac.getSecretToken());
            return oAuthToken;
        } else {
            throw new EnMeNoResultsFoundException("connection not found");
        }
View Full Code Here

TOP

Related Classes of org.encuestame.utils.oauth.OAuth1Token

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.