From e47d6d27d834ddb8f4418130158b8ab6ec7ff7ff Mon Sep 17 00:00:00 2001
From: Jaime Perez <jaime.perez@uninett.no>
Date: Wed, 5 Mar 2014 15:55:16 +0100
Subject: [PATCH] Get attributes from session in a proper way.

---
 modules/oauth/www/authorize.php     | 2 +-
 modules/oauth/www/registry.edit.php | 2 +-
 modules/oauth/www/registry.php      | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/oauth/www/authorize.php b/modules/oauth/www/authorize.php
index ed92f1460..b8e5bf3b7 100644
--- a/modules/oauth/www/authorize.php
+++ b/modules/oauth/www/authorize.php
@@ -48,7 +48,7 @@ try {
 		exit();	// and be done.
 	}
 
-	$attributes = $session->getAttributes();
+	$attributes = $session->getAuthData($as, 'Attributes');
 
 	// Assume user consent at this point and proceed with authorizing the token
 	list($url, $verifier) = $store->authorize($requestToken, $attributes);
diff --git a/modules/oauth/www/registry.edit.php b/modules/oauth/www/registry.edit.php
index 972e10461..1b752cdc7 100644
--- a/modules/oauth/www/registry.edit.php
+++ b/modules/oauth/www/registry.edit.php
@@ -13,7 +13,7 @@ $useridattr = $oauthconfig->getValue('useridattr', 'user');
 //$useridattr = $oauthconfig->getValue('useridattr', 'uid');
 
 if ($session->isValid($authsource)) {
-	$attributes = $session->getAttributes();
+	$attributes = $session->getAuthData($authsource, 'Attributes');
 	// Check if userid exists
 	if (!isset($attributes[$useridattr])) 
 		throw new Exception('User ID is missing');
diff --git a/modules/oauth/www/registry.php b/modules/oauth/www/registry.php
index c7ac52c7f..52b06f2e1 100644
--- a/modules/oauth/www/registry.php
+++ b/modules/oauth/www/registry.php
@@ -13,7 +13,7 @@ $useridattr = $oauthconfig->getValue('useridattr', 'user');
 //$useridattr = $oauthconfig->getValue('useridattr', 'uid');
 
 if ($session->isValid($authsource)) {
-	$attributes = $session->getAttributes();
+	$attributes = $session->getAuthData($authsource, 'Attributes');
 	// Check if userid exists
 	if (!isset($attributes[$useridattr])) 
 		throw new Exception('User ID is missing');
-- 
GitLab