Examples of OAuthSession


Examples of org.agorava.api.oauth.OAuthSession

        endDance();
    }

    @Override
    public OAuthSession buildSessionFor(String providerName) {
        OAuthSession res;
        Annotation qualifier = getServicesToQualifier().get(providerName);
        if (qualifier == null) {
            throw new AgoravaException("Cannot find configured service provider with name : " + providerName);
        }
        return buildSessionFor(qualifier);
View Full Code Here

Examples of org.agorava.api.oauth.OAuthSession

        return buildSessionFor(qualifier);
    }

    @Override
    public OAuthSession buildSessionFor(Annotation qualifier) {
        OAuthSession res = new OAuthSession.Builder().qualifier(qualifier).repo(unProxifyRepo(getCurrentRepository())).build();
        getCurrentRepository().setCurrent(res);
        return res;
    }
View Full Code Here

Examples of org.agorava.api.oauth.OAuthSession

        return globalRepository.get(repo.getId());
    }

    @Override
    public OAuthSession resolveSessionForQualifier(Annotation qualifier) {
        OAuthSession current = getCurrentSession();
        if (current.getServiceQualifier().equals(qualifier)) {
            return current;
        }
        if (getCurrentRepository().getCurrent().equals(OAuthSession.NULL)) {
            buildSessionFor(qualifier);
        } else if (!getCurrentRepository().getCurrent().getServiceQualifier().equals(qualifier)) {
View Full Code Here

Examples of org.agorava.api.oauth.OAuthSession

        return getCurrentRepository().getCurrent();
    }

    @Override
    public String startDanceFor(String providerName, String internalCallBack) {
        OAuthSession session = buildSessionFor(providerName);
        if (internalCallBack != null && !"".equals(internalCallBack.trim())) {
            session.getExtraData().put(AgoravaConstants.INTERN_CALLBACK_PARAM, internalCallBack);
        }
        return getCurrentService().getAuthorizationUrl();
    }
View Full Code Here

Examples of org.agorava.api.oauth.OAuthSession

    protected OAuthSession resolveOAuthSession(InjectionPoint ip, @Current UserSessionRepository repository) {
        if (ip == null) {
            throw new UnsupportedOperationException("Cannot resolve session for a null InjectionPoint");
        }
        Annotation qual = AnnotationUtils.getSingleProviderRelatedQualifier(ip.getQualifiers(), false);
        OAuthSession res = repository.getForProvider(qual);
        if (res.isNull()) {
            throw new AgoravaException("There's no active session for requested provider");
        }
        return res;
    }
View Full Code Here

Examples of org.agorava.api.oauth.OAuthSession

    }

    @PostConstruct
    protected void init() {
        UserSessionRepository r;
        OAuthSession s;

        s = globalRepository.getOauthSession(getSessionId());
        if (s != null) {
            currentSession = s;
            currentRepo = s.getRepo();

        } else {
            r = globalRepository.get(getRepoId());
            if (r != null) {
                currentRepo = r;
View Full Code Here

Examples of org.agorava.core.api.oauth.OAuthSession

        if(request == null || response == null) {
            setStatus(AuthenticationStatus.FAILURE);
        } else {
            if(session.isConnected()) { // already got a active session going
                OAuthSession session = service.getSession();
                UserProfile userProfile = session.getUserProfile();

                User user = repository.get(userProfile.getId());
                if(user == null) {  // can't find a matching account, shouldn't really happen
                    setStatus(AuthenticationStatus.FAILURE);
                } else {
                    setAccount(new UserAccount(user));
                    setStatus(AuthenticationStatus.SUCCESS);
                }
            } else {
                // Callback
                String verifier = request.getParameter(service.getVerifierParamName());
                if(verifier != null) {
                    session.setVerifier(verifier);
                    service.initAccessToken();

                    // https://issues.jboss.org/browse/AGOVA-53
                    successful.fire(new SuccessfulAuthentication(service.getSession().getUserProfile(), service.getAccessToken()));
View Full Code Here

Examples of org.encuestame.utils.oauth.OAuthSession

    /**
     * Get Session.
     */
    public OAuthSession getSession(String requestToken) throws EnMeNotValidKeyOAuthSecurityException {
        OAuthSession session = sessions.get(requestToken);
        log.trace("OAuth Session SE "+session.getSecret());
        log.trace("OAuth Session AP "+session.getApiKey());
        log.trace("OAuth Session RT "+session.getRequestToken());
        if (session == null) {
            log.error("OAuth Session is null");
            throw new EnMeNotValidKeyOAuthSecurityException(requestToken);
        }
        return session;
View Full Code Here

Examples of org.jboss.seam.social.oauth.OAuthSession

    @Override
    public void connect() {

        OAuthService currentService;
        OAuthSession currentSession;

        if (serviceName != null) {
            MultiServicesManager manager = multiServicesManager;
            manager.connectCurrentService();

            currentService = manager.getCurrentService();
            currentSession = manager.getCurrentSession();
        } else {
            currentService = getUnambiguousService();
            currentSession = currentService.getSession();

            currentService.initAccessToken();
        }

        OAuthUser user = new OAuthUser(currentService.getType(), currentSession.getUserProfile());

        if (isIdentityManaged()) {
            // By default we set the status to FAILURE, if we manage to get to the end
            // of this method we get rewarded with a SUCCESS
            setStatus(AuthenticationStatus.FAILURE);
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.