From 3972068c42d35119b8e90012f9b4c42fec028f4a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no>
Date: Wed, 12 Aug 2009 05:58:10 +0000
Subject: [PATCH] Added support for redirecting back to callback url at the
 OAuth Authorize endpoint

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1649 44740490-163a-0410-bde0-09ae8108e29a
---
 modules/oauth/www/authorize.php | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/modules/oauth/www/authorize.php b/modules/oauth/www/authorize.php
index fe67606dd..fc09b8656 100644
--- a/modules/oauth/www/authorize.php
+++ b/modules/oauth/www/authorize.php
@@ -33,16 +33,23 @@ $attributes = $session->getAttributes();
 
 $store->authorize($requestToken, $attributes);
 
-$t = new SimpleSAML_XHTML_Template($config, 'oauth:authorized.php');
-
-$t->data['header'] = '{status:header_saml20_sp}';
-$t->data['remaining'] = $session->remainingTime();
-$t->data['sessionsize'] = $session->getSize();
-$t->data['attributes'] = $attributes;
-$t->data['logouturl'] = SimpleSAML_Utilities::selfURLNoQuery() . '?logout';
-$t->data['icon'] = 'bino.png';
-$t->show();
-
+if (isset($_REQUEST['oauth_callback'])) {
+	
+	SimpleSAML_Utilities::redirect($_REQUEST['oauth_callback']);
+	
+} else {
+
+
+	$t = new SimpleSAML_XHTML_Template($config, 'oauth:authorized.php');
+
+	$t->data['header'] = '{status:header_saml20_sp}';
+	$t->data['remaining'] = $session->remainingTime();
+	$t->data['sessionsize'] = $session->getSize();
+	$t->data['attributes'] = $attributes;
+	$t->data['logouturl'] = SimpleSAML_Utilities::selfURLNoQuery() . '?logout';
+	$t->data['icon'] = 'bino.png';
+	$t->show();
+}
 
 
 
-- 
GitLab