@@ -53,6 +53,8 @@ class Disco extends PowerIdPDisco
5353
5454 public const ADD_AUTHN_CONTEXT_CLASSES_FOR_MFA = 'add_authn_context_classes_for_mfa ' ;
5555
56+ public const SKIP_PREVIOUS_SELECTION = 'skip_previous_selection_services ' ;
57+
5658 // CONFIGURATION ENTRIES IDP BLOCKS
5759 public const IDP_BLOCKS = 'idp_blocks_config ' ;
5860
@@ -117,6 +119,8 @@ class Disco extends PowerIdPDisco
117119
118120 public const IDP_ENTITY_ID = 'entityid ' ;
119121
122+ public const SP_ENTITY_ID = 'entityid ' ;
123+
120124 public const IDP_COLOR = 'color ' ;
121125
122126 public const IDP_FULL_DISPLAY_NAME = 'fullDisplayName ' ;
@@ -282,6 +286,11 @@ public function handleRequest()
282286 $ this ->fillSpName ($ t );
283287 }
284288
289+ $ spsToSkipPreviousSelection = $ this ->wayfConfiguration ->getArray (self ::SKIP_PREVIOUS_SELECTION , []);
290+ $ spIdentifier = $ this ->getSpIdentifier ($ t );
291+
292+ $ skipPreviousSelection = in_array ($ spIdentifier , $ spsToSkipPreviousSelection , true );
293+
285294 $ t ->data [self ::ORIGINAL_SP ] = $ this ->originalsp ;
286295 $ t ->data [self ::IDP_LIST ] = $ this ->idplistStructured ($ idpList );
287296 $ t ->data [self ::PREFERRED_IDP ] = $ preferredIdP ;
@@ -293,6 +302,7 @@ public function handleRequest()
293302 $ t ->data [self ::WAYF ] = $ this ->wayfConfiguration ;
294303 $ t ->data [self ::NAME ] = $ this ->spName ;
295304 $ t ->data [self ::DISPLAY_SP ] = $ this ->displaySpName ;
305+ $ t ->data [self ::SKIP_PREVIOUS_SELECTION ] = $ skipPreviousSelection ;
296306 $ t ->show ();
297307 }
298308
@@ -961,8 +971,8 @@ private function fillSpNameForOidc($t, $clientIdWithPrefix)
961971 private function fillSpNameForSaml ($ t )
962972 {
963973 $ this ->spName = null ;
964- if (!empty ($ this ->originalsp [' entityid ' ])) {
965- $ entityId = $ this ->originalsp [' entityid ' ];
974+ if (!empty ($ this ->originalsp [self :: SP_ENTITY_ID ])) {
975+ $ entityId = $ this ->originalsp [self :: SP_ENTITY_ID ];
966976 $ entityIdAttr = $ this ->wayfConfiguration ->getString (self ::ENTITY_ID_ATTR , null );
967977 if (null === $ entityIdAttr ) {
968978 $ facility = $ this ->adapter ->getFacilityByEntityId ($ entityId );
@@ -994,4 +1004,17 @@ private function prepareAcrsForMfa(array &$state)
9941004 $ contextsToAdd = $ this ->wayfConfiguration ->getArray (self ::ADD_AUTHN_CONTEXT_CLASSES_FOR_MFA , []);
9951005 MultifactorAcrs::addAndStoreAcrs ($ state , $ contextsToAdd );
9961006 }
1007+
1008+ private function getSpIdentifier ()
1009+ {
1010+ $ clientIdWithPrefix = self ::substrInArray (self ::CLIENT_ID_PREFIX , $ this ->originalAuthnContextClassRef );
1011+
1012+ if (null !== $ clientIdWithPrefix ) {
1013+ $ parts = explode (': ' , $ clientIdWithPrefix );
1014+
1015+ return end ($ parts ); // clientId
1016+ }
1017+
1018+ return empty ($ this ->originalsp [self ::SP_ENTITY_ID ]) ? null : $ this ->originalsp [self ::SP_ENTITY_ID ];
1019+ }
9971020}
0 commit comments