Package com.example.GWTOAuthLoginDemo.client.exception

Examples of com.example.GWTOAuthLoginDemo.client.exception.OurException


        int authProvider = credential.getAuthProvider();
       
        OAuthService service = getOAuthService(authProvider);
        if (service == null)
        {
            throw new OurException("Could not build OAuthService");
        }
       
       
        if (authProvider == ClientUtils.TWITTER    ||
            authProvider == ClientUtils.YAHOO      ||
            authProvider == ClientUtils.LINKEDIN   ||
            authProvider == ClientUtils.FLICKR     ||
            authProvider == ClientUtils.IMGUR      ||
            authProvider == ClientUtils.TUMBLR     ||
            authProvider == ClientUtils.VIMEO)
        {
            String authProviderName = ClientUtils.getAuthProviderName(authProvider);
            logger.info(authProviderName + " requires Request token first.. obtaining..");
            try
            {
                requestToken = service.getRequestToken();
                logger.info("Got request token: " + requestToken);
                // we must save in the session. It will be required to
                // get the access token
                saveRequestTokenToSession(requestToken);
            }
            catch(Exception e)
            {
                String stackTrace = stackTraceToString(e);
                throw new OurException("Could not get request token for " + authProvider + " " + stackTrace);
            }
           
        }
        logger.info("Getting Authorization url...");
        try
        {
            authorizationUrl = service.getAuthorizationUrl(requestToken);
           
            // Facebook has optional state var to protect against CSFR.
            // We'll use it
            if (authProvider == ClientUtils.FACEBOOK ||
                authProvider == ClientUtils.GITHUB   ||
                authProvider == ClientUtils.INSTAGRAM)
            {
                String state=makeRandomString();
                authorizationUrl+="&state=" + state;
                saveStateToSession(state);
            }
        }
        catch(Exception e)
        {
            String st = LogUtil.stackTraceToString(e);
            throw new OurException("Could not get Authorization url: " + st);
        }
       
        if (authProvider == ClientUtils.FLICKR)
        {
            authorizationUrl += "&perms=read";
View Full Code Here


    private void saveRequestTokenToSession(Token requestToken) throws OurException
    {
        HttpSession session = getHttpSession();
        if (session == null)
        {
            throw new OurException(ClientUtils.SESSION_EXPIRED_MESSAGE);
        }
        /*
        ServersideSession sss = getServersideSession();
        if (sss == null)
        {
View Full Code Here

    private void saveStateToSession(String state) throws OurException
    {
        HttpSession session = getHttpSession();
        if (session == null)
        {
            throw new OurException(ClientUtils.SESSION_EXPIRED_MESSAGE);
        }
        /*
        ServersideSession sss = getServersideSession();
        if (sss == null)
        {
View Full Code Here

    private void saveSessionIdToSession(String sessionId) throws OurException
    {
        HttpSession session = getHttpSession();
        if (session == null)
        {
            throw new OurException(ClientUtils.SESSION_EXPIRED_MESSAGE);
        }
        session.setAttribute(SESSION_ID,sessionId);
        /*
        ServersideSession sss = getServersideSession();
        if (sss == null)
View Full Code Here

    private void saveProtectedResourceUrlToSession(String url) throws OurException
    {
        HttpSession session = getHttpSession();
        if (session == null)
        {
            throw new OurException(ClientUtils.SESSION_EXPIRED_MESSAGE);
        }
        /*
        ServersideSession sss = getServersideSession();
        if (sss == null)
        {
View Full Code Here

    private void saveAuthProviderToSession(int authProvider) throws OurException
    {
        HttpSession session = getHttpSession();
        if (session == null)
        {
            throw new OurException(ClientUtils.SESSION_EXPIRED_MESSAGE);
        }
        /*
        ServersideSession sss = getServersideSession();
        if (sss == null)
        {
View Full Code Here

    private void saveAccessTokenToSession(Token accessToken) throws OurException
    {
        HttpSession session = getHttpSession();
        if (session == null)
        {
            throw new OurException(ClientUtils.SESSION_EXPIRED_MESSAGE);
        }
        /*
        ServersideSession sss = getServersideSession();
        if (sss == null)
        {
View Full Code Here

    private void saveYahooGuidToSession(String guid) throws OurException
    {
        HttpSession session = getHttpSession();
        if (session == null)
        {
            throw new OurException(ClientUtils.SESSION_EXPIRED_MESSAGE);
        }
        /*
        ServersideSession sss = getServersideSession();
        if (sss == null)
        {
View Full Code Here

    private String getYahooGuidFromSession() throws OurException
    {
        HttpSession session = getHttpSession();
        if (session == null)
        {
            throw new OurException(ClientUtils.SESSION_EXPIRED_MESSAGE);
        }
        /*
        ServersideSession sss = getServersideSession();
        if (sss != null)
        {
View Full Code Here

    private String getProtectedResourceUrlFromSession() throws OurException
    {
        HttpSession session = getHttpSession();
        if (session == null)
        {
            throw new OurException(ClientUtils.SESSION_EXPIRED_MESSAGE);
        }
        /*
        ServersideSession sss = getServersideSession();
        if (sss != null)
            return sss.getProtectedResourceUrl();
View Full Code Here

TOP

Related Classes of com.example.GWTOAuthLoginDemo.client.exception.OurException

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.