Examples of StandardOAuthSession


Examples of org.encuestame.utils.oauth.StandardOAuthSession

    /**
     * New OAuth Session.
     */
    public OAuthSession newOAuthSession(String apiKey, String callbackUrl) {
        final StandardOAuthSession session = new StandardOAuthSession(apiKey, callbackUrl, keyGenerator.generateKey(), keyGenerator.generateKey());
        log.debug("New OAuth StandardOAuthSession"+session.getApiKey());
        log.debug("New OAuth StandardOAuthSession"+session.getSecret());
        log.debug("New OAuth StandardOAuthSession"+session.getVerifier());
        log.debug("New OAuth StandardOAuthSession"+session.getCallbackUrl());
        sessions.put(session.getRequestToken(), session);
        return session;
    }
View Full Code Here

Examples of org.encuestame.utils.oauth.StandardOAuthSession

     * @return
     * @throws EnMeNotValidKeyOAuthSecurityException
     */
    public ApplicationConnection grantAccess(String requestToken) throws EnMeNotValidKeyOAuthSecurityException {
        log.debug("Grant Access");
        StandardOAuthSession session = getStandardSession(requestToken);
        if (!session.authorized()) {
            throw new IllegalStateException("OAuthSession is not yet authorized");
        }
        log.debug("Grant Access is authorized "+session.authorized());
        try {
            ApplicationConnection connection = this.applicationDao.connectApplication(
                                  session.getAuthorizingAccountId(), session.getApiKey());
            log.debug("Grant Access new connection "+connection.getConnectionId());
            sessions.remove(requestToken);
            return connection;
        } catch (Exception e) {
            throw new IllegalStateException("Unable to grant access due to session - have the App's key changed?", e);
View Full Code Here

Examples of org.encuestame.utils.oauth.StandardOAuthSession

     * Authorize application.
     */
    public OAuthSession authorize(String requestToken,
            Long authorizingAccountId, String verifier)
            throws EnMeNotValidKeyOAuthSecurityException {
        final StandardOAuthSession session = getStandardSession(requestToken);
        log.debug("Authorize session");
        if (session.authorized()) {
            throw new IllegalStateException("OAuthSession is already authorized");
        }
        log.debug("Authorize session RT "+session.getRequestToken());
        session.authorize(authorizingAccountId, verifier);
        return session;
    }
View Full Code Here

Examples of org.encuestame.utils.oauth.StandardOAuthSession

//        assertNotNull(tk.getSecret());
//        assertNotNull(tk.getValue());
//        assertNotNull(tk.getVerifier());
//        assertNotNull(token.getSecret());
//        assertNotNull(token.getValue());
        final StandardOAuthSession oa = new StandardOAuthSession("api", "call", "token", "secret");
        oa.authorize(1235L, "veri");
        assertNotNull(oa.getApiKey());
        assertNotNull(oa.getCallbackUrl());
        assertNotNull(oa.getRequestToken());
        assertNotNull(oa.getSecret());
        assertNotNull(oa.getVerifier());
        assertNotNull(oa.getAuthorizingAccountId());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.