Skip to content

Commit 2892423

Browse files
committed
throw on invalid client document
1 parent 2d4346a commit 2892423

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/ClientRegistration.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ public static function getRegistration($clientId) {
2626
public static function getRemoteRegistration($url) {
2727
$clientDocument = file_get_contents($url);
2828
$clientRegistration = json_decode($clientDocument, true);
29+
if (!isset($clientRegistration['client_id'])) {
30+
throw new \Exception("No client ID found in client document");
31+
}
32+
if (!isset($clientRegistration['redirect_uris'])) {
33+
throw new \Exception("No redirect URIs found in client document");
34+
}
2935
return $clientRegistration;
3036
}
3137

0 commit comments

Comments
 (0)