PortalRequestContext portalRequestContext = Util.getPortalRequestContext();
// Save OAuth username as part of user profile of new user
OrganizationService orgService = uiRegisterForm.getApplicationComponent(OrganizationService.class);
UserProfileHandler profileHandler = orgService.getUserProfileHandler();
UserProfile newUserProfile = profileHandler.findUserProfileByName(newUser.getUserName());
AuthenticationRegistry authRegistry = uiRegisterForm.getApplicationComponent(AuthenticationRegistry.class);
HttpServletRequest httpRequest = portalRequestContext.getRequest();
OAuthPrincipal oauthPrincipal = (OAuthPrincipal)authRegistry.getAttributeOfClient(httpRequest, OAuthConstants.ATTRIBUTE_AUTHENTICATED_OAUTH_PRINCIPAL);