Package org.gatein.security.oauth.spi

Examples of org.gatein.security.oauth.spi.OAuthProviderProcessor


            String oauthProviderUsername = userProfile.getAttribute(opt.getUserNameAttrName());
            String foundOauthProviderUsername = foundUserProfile.getAttribute(opt.getUserNameAttrName());

            // This means that oauthUsername has been changed. We may need to invalidate current accessToken as well
            if (!Safe.equals(oauthProviderUsername, foundOauthProviderUsername)) {
                OAuthProviderProcessor processor = opt.getOauthProviderProcessor();
                Object currentAccessToken = processor.getAccessTokenFromUserProfile(userProfile, oauthCodec);
                Object foundAccessToken = processor.getAccessTokenFromUserProfile(foundUserProfile, oauthCodec);

                // In this case, we need to remove existing accessToken
                if (currentAccessToken != null && currentAccessToken.equals(foundAccessToken)) {
                    if (log.isTraceEnabled()) {
                        log.trace("Removing accessToken for oauthProvider=" + opt + ", username=" + userProfile.getUserName());
                    }
                    processor.removeAccessTokenFromUserProfile(userProfile);
                }
            }
        }
    }
View Full Code Here


            String oauthProviderUsername = userProfile.getAttribute(opt.getUserNameAttrName());
            String foundOauthProviderUsername = foundUserProfile.getAttribute(opt.getUserNameAttrName());

            // This means that oauthUsername has been changed. We may need to invalidate current accessToken as well
            if (!Safe.equals(oauthProviderUsername, foundOauthProviderUsername)) {
                OAuthProviderProcessor processor = opt.getOauthProviderProcessor();
                Object currentAccessToken = processor.getAccessTokenFromUserProfile(userProfile, oauthCodec);
                Object foundAccessToken = processor.getAccessTokenFromUserProfile(foundUserProfile, oauthCodec);

                // In this case, we need to remove existing accessToken
                if (currentAccessToken != null && currentAccessToken.equals(foundAccessToken)) {
                    if (log.isTraceEnabled()) {
                        log.trace("Removing accessToken for oauthProvider=" + opt + ", username=" + userProfile.getUserName());
                    }
                    processor.removeAccessTokenFromUserProfile(userProfile);
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.gatein.security.oauth.spi.OAuthProviderProcessor

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.