From d935c21cbea44d68a11da57b0b9e4615b101ca14 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no>
Date: Tue, 12 Jan 2010 06:58:52 +0000
Subject: [PATCH] make it configurable which auth source to use when
 authorizing a OAuth request

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2096 44740490-163a-0410-bde0-09ae8108e29a
---
 modules/oauth/www/authorize.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/oauth/www/authorize.php b/modules/oauth/www/authorize.php
index fc09b8656..49a5e2e35 100644
--- a/modules/oauth/www/authorize.php
+++ b/modules/oauth/www/authorize.php
@@ -2,6 +2,8 @@
 
 require_once(dirname(dirname(__FILE__)) . '/libextinc/OAuth.php');
 
+$oauthconfig = SimpleSAML_Configuration::getOptionalConfig('module_oauth.php');
+
 if(!array_key_exists('oauth_token', $_REQUEST)) {
 	throw new Exception('Required URL parameter [oauth_token] is missing.');
 }
@@ -22,7 +24,7 @@ $server->add_signature_method($plaintext_method);
 $config = SimpleSAML_Configuration::getInstance();
 $session = SimpleSAML_Session::getInstance();
 
-$as = 'saml2';
+$as = $oauthconfig->getString('auth');
 if (!$session->isValid($as)) {
 	SimpleSAML_Auth_Default::initLogin($as, SimpleSAML_Utilities::selfURL());
 }
-- 
GitLab