diff --git a/lib/Auth/Source/Campusidp.php b/lib/Auth/Source/Campusidp.php
index e28619e2ed2aa84df6b6afda9c0d48889f7bbb94..04ad46fd2b19897eefefa47f35d4e26c4e358c52 100644
--- a/lib/Auth/Source/Campusidp.php
+++ b/lib/Auth/Source/Campusidp.php
@@ -23,6 +23,7 @@ class Campusidp extends Source
     public const SOURCESID = '\SimpleSAML\Module\campusidp\Auth\Source\Campusidp.SourceId';
     public const SESSION_SOURCE = 'campusMultiauth:selectedSource';
     public const USER_PASS_SOURCE_NAME = 'userPassSourceName';
+    public const SP_SOURCE_NAME = 'spSourceName';
     public const COOKIE_PREFIX = 'campusidp_';
     public const COOKIE_IDP_ENTITY_ID = 'idpentityid';
     public const COOKIE_INSTITUTION_NAME = 'institution_name';
@@ -33,37 +34,48 @@ class Campusidp extends Source
 
     private $sources;
     private $userPassSourceName;
+    private $spSourceName;
 
 
     public function __construct($info, $config)
     {
         parent::__construct($info, $config);
 
-        $this->userPassSourceName = !empty($config['userPassSourceName']) ? $config['userPassSourceName'] : 'campus-userpass';
+        $this->sources = [];
+
+        $this->userPassSourceName = !empty($config['userPassSource']['name']) ? $config['userPassSource']['name'] : 'campus-userpass';
 
-        if (!array_key_exists('sources', $config)) {
-            throw new Exception('The required "sources" config option was not found');
+        $userPassClassRef = [];
+        if (!empty($config['userPassSource']['AuthnContextClassRef'])) {
+            $ref = $config['userPassSource']['AuthnContextClassRef'];
+            if (is_string($ref)) {
+                $userPassClassRef = [$ref];
+            } else {
+                $userPassClassRef = $ref;
+            }
         }
 
-        $this->sources = [];
+        $this->sources[] = [
+            'source' => $this->userPassSourceName,
+            'AuthnContextClassRef' => $userPassClassRef,
+        ];
 
-        $sources = $config['sources'];
-        foreach ($sources as $source => $info) {
-            $class_ref = [];
-            if (array_key_exists('AuthnContextClassRef', $info)) {
-                $ref = $info['AuthnContextClassRef'];
-                if (is_string($ref)) {
-                    $class_ref = [$ref];
-                } else {
-                    $class_ref = $ref;
-                }
-            }
+        $this->spSourceName = !empty($config['spSource']['name']) ? $config['spSource']['name'] : 'default-sp';
 
-            $this->sources[] = [
-                'source' => $source,
-                'AuthnContextClassRef' => $class_ref,
-            ];
+        $spClassRef = [];
+        if (!empty($config['spSource']['AuthnContextClassRef'])) {
+            $ref = $config['spSource']['AuthnContextClassRef'];
+            if (is_string($ref)) {
+                $spClassRef = [$ref];
+            } else {
+                $spClassRef = $ref;
+            }
         }
+
+        $this->sources[] = [
+            'source' => $this->spSourceName,
+            'AuthnContextClassRef' => $spClassRef,
+        ];
     }
 
     public function authenticate(&$state)
@@ -71,6 +83,7 @@ class Campusidp extends Source
         $state[self::AUTHID] = $this->authId;
         $state[self::SOURCESID] = $this->sources;
         $state[self::USER_PASS_SOURCE_NAME] = $this->userPassSourceName;
+        $state[self::SP_SOURCE_NAME] = $this->spSourceName;
 
         // Save the $state array, so that we can restore if after a redirect
         $id = State::saveState($state, self::STAGEID_USERPASS);
diff --git a/themes/campusThemes/default/individual-identities.twig b/themes/campusThemes/default/individual-identities.twig
index 73f1f978c70da9d6707214166a2e5d47c6012b29..edae33f4ab26eb79b2e424d05fb9a153cf3f8050 100644
--- a/themes/campusThemes/default/individual-identities.twig
+++ b/themes/campusThemes/default/individual-identities.twig
@@ -47,7 +47,7 @@
     {% endfor %}
 
     <input type="hidden" id="authstate" name="authstate" value="{{ authstate }}" />
-    <input type="hidden" id="source" name="source" value="default-sp" />
+    <input type="hidden" id="source" name="source" value="{{ sp_source_name }}" />
 </form>
 
 {% if configuration.identities|length > configuration.number_shown %}
diff --git a/themes/campusThemes/default/searchbox.twig b/themes/campusThemes/default/searchbox.twig
index 3f3156c3ea8a2a26bca850987332931ae43e03a9..57bd581f31c7c3b130b95fa6b4b399cfd8bf7007 100644
--- a/themes/campusThemes/default/searchbox.twig
+++ b/themes/campusThemes/default/searchbox.twig
@@ -57,7 +57,7 @@
 
         <input type="hidden" id="componentIndex" name="componentIndex" value="{{ component_index }}" />
         <input type="hidden" id="authstate" name="authstate" value="{{ authstate }}" />
-        <input type="hidden" id="source" name="source" value="default-sp" />
+        <input type="hidden" id="source" name="source" value="{{ sp_source_name }}" />
     </form>
 </div>
 
@@ -139,7 +139,7 @@
             {% endfor %}
 
             <input type="hidden" id="authstate" name="authstate" value="{{ authstate }}" />
-            <input type="hidden" id="source" name="source" value="default-sp" />
+            <input type="hidden" id="source" name="source" value="{{ sp_source_name }}" />
         </form>
     </div>
 {% endif %}
diff --git a/www/selectsource.php b/www/selectsource.php
index 080ca555bc97a5524e91f35bface50d02086fbf0..e3f738dac7c0782fe60801da8c7ddf1fd04c8d7a 100644
--- a/www/selectsource.php
+++ b/www/selectsource.php
@@ -88,6 +88,7 @@ $t->data['wayf_config'] = $wayfConfig;
 $t->data['idps'] = $idps;
 $t->data['no_js_display_index'] = !empty($_POST['componentIndex']) ? $_POST['componentIndex'] : null;
 $t->data['user_pass_source_name'] = $state[Campusidp::USER_PASS_SOURCE_NAME];
+$t->data['sp_source_name'] = $state[Campusidp::SP_SOURCE_NAME];
 $t->data['cookie_idpentityid'] = Campusidp::getCookie(Campusidp::COOKIE_IDP_ENTITY_ID);
 $t->data['cookie_institution_name'] = json_decode(Campusidp::getCookie(Campusidp::COOKIE_INSTITUTION_NAME), true);
 $t->data['cookie_institution_img'] = Campusidp::getCookie(Campusidp::COOKIE_INSTITUTION_IMG);