function oauth2_user_get_from_server in OAuth2 Login 8
Same name and namespace in other branches
- 7.2 oauth2_user/profile.inc \oauth2_user_get_from_server()
Get the profile of the oauth2 user from the server.
2 calls to oauth2_user_get_from_server()
- oauth2_user_get in oauth2_user/
profile.inc - Get the profile of the oauth2 user.
- oauth2_user_get in oauth2_user/
oauth2_user.api.php - Get the profile of the oauth2 user.
File
- oauth2_user/
profile.inc, line 23 - OAuth2 user profile.
Code
function oauth2_user_get_from_server() {
if (!oauth2_user_is_authenticated()) {
return NULL;
}
$oauth2 = wsclient_service_load('oauth2');
$oauth2_user = $oauth2
->user_profile();
oauth2_user_save($oauth2_user);
return $_SESSION['oauth2_user']['profile'];
}