File tree Expand file tree Collapse file tree
modules/go5auth/lib/Auth/Source Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,6 +27,15 @@ public function authenticate(&$state)
2727 exit ;
2828 }
2929
30+ $ metadataSP = $ state ['SPMetadata ' ];
31+ $ metadataIDP = $ state ['IdPMetadata ' ];
32+
33+ if (!$ metadataSP ['enabled ' ] || !$ metadataIDP ['enabled ' ] || $ metadataSP ['platformId ' ] != $ metadataIDP ['platformId ' ]) {
34+ header ('HTTP/1.1 401 Unauthorized ' );
35+ echo 'go5auth | error: invalid platform idp ' ;
36+ exit ;
37+ }
38+
3039 $ accessToken = isset ($ _REQUEST ['access_token ' ])
3140 ? $ _REQUEST ['access_token ' ]
3241 : trim (substr ($ _SERVER ['HTTP_AUTHORIZATION ' ], 7 ));
@@ -42,7 +51,7 @@ public function authenticate(&$state)
4251
4352 $ userAttributes = [];
4453 $ userInfoAttributes = $ userInfo ->data ->attributes ;
45- $ userAttributesMapping = $ state [ ' SPMetadata ' ] ['UserAttributesMapping ' ];
54+ $ userAttributesMapping = $ metadataSP ['UserAttributesMapping ' ];
4655
4756 if (is_array ($ userAttributesMapping ) && !empty ($ userAttributesMapping )) {
4857 foreach ($ userAttributesMapping as $ mappedAttributeKey => $ mappedAttributeValue ) {
You can’t perform that action at this time.
0 commit comments