From 4a13d06aeb609ab5e339790ca211932dd8a768f4 Mon Sep 17 00:00:00 2001 From: Jason Gill Date: Mon, 18 Dec 2023 10:34:12 -0500 Subject: [PATCH 1/3] Update README.md Correct the calls to addScope which now requires an array, not a string --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 79318e50..bf373b0f 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ $oidc = new OpenIDConnectClient('https://id.provider.com', 'ClientIDHere', 'ClientSecretHere'); $oidc->providerConfigParam(array('token_endpoint'=>'https://id.provider.com/connect/token')); -$oidc->addScope('my_scope'); +$oidc->addScope(['my_scope']); // this assumes success (to validate check if the access_token property is there and a valid JWT) : $clientCredentialsToken = $oidc->requestClientCredentialsToken()->access_token; @@ -86,7 +86,7 @@ $oidc = new OpenIDConnectClient('https://id.provider.com', 'ClientIDHere', 'ClientSecretHere'); $oidc->providerConfigParam(array('token_endpoint'=>'https://id.provider.com/connect/token')); -$oidc->addScope('my_scope'); +$oidc->addScope(['my_scope']); //Add username and password $oidc->addAuthParam(array('username'=>'')); @@ -106,7 +106,7 @@ $oidc = new OpenIDConnectClient('https://id.provider.com', 'ClientIDHere', 'ClientSecretHere'); $oidc->setResponseTypes(array('id_token')); -$oidc->addScope(array('openid')); +$oidc->addScope(['openid']); $oidc->setAllowImplicitFlow(true); $oidc->addAuthParam(array('response_mode' => 'form_post')); $oidc->setCertPath('/path/to/my.cert'); From eca09ab1a65d0d629a2ecb552cc2360e48039066 Mon Sep 17 00:00:00 2001 From: Jason Gill Date: Mon, 18 Dec 2023 20:03:27 -0500 Subject: [PATCH 2/3] Replaced usage of array() with [] --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index bf373b0f..5b6e8587 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ use Jumbojett\OpenIDConnectClient; $oidc = new OpenIDConnectClient('https://id.provider.com', 'ClientIDHere', 'ClientSecretHere'); -$oidc->providerConfigParam(array('token_endpoint'=>'https://id.provider.com/connect/token')); +$oidc->providerConfigParam(['token_endpoint'=>'https://id.provider.com/connect/token']); $oidc->addScope(['my_scope']); // this assumes success (to validate check if the access_token property is there and a valid JWT) : @@ -85,12 +85,12 @@ use Jumbojett\OpenIDConnectClient; $oidc = new OpenIDConnectClient('https://id.provider.com', 'ClientIDHere', 'ClientSecretHere'); -$oidc->providerConfigParam(array('token_endpoint'=>'https://id.provider.com/connect/token')); +$oidc->providerConfigParam(['token_endpoint'=>'https://id.provider.com/connect/token']); $oidc->addScope(['my_scope']); //Add username and password -$oidc->addAuthParam(array('username'=>'')); -$oidc->addAuthParam(array('password'=>'')); +$oidc->addAuthParam(['username'=>'']); +$oidc->addAuthParam(['password'=>'']); //Perform the auth and return the token (to validate check if the access_token property is there and a valid JWT) : $token = $oidc->requestResourceOwnerToken(TRUE)->access_token; @@ -105,10 +105,10 @@ use Jumbojett\OpenIDConnectClient; $oidc = new OpenIDConnectClient('https://id.provider.com', 'ClientIDHere', 'ClientSecretHere'); -$oidc->setResponseTypes(array('id_token')); +$oidc->setResponseTypes(['id_token']); $oidc->addScope(['openid']); $oidc->setAllowImplicitFlow(true); -$oidc->addAuthParam(array('response_mode' => 'form_post')); +$oidc->addAuthParam(['response_mode' => 'form_post']); $oidc->setCertPath('/path/to/my.cert'); $oidc->authenticate(); $sub = $oidc->getVerifiedClaims('sub'); @@ -184,7 +184,7 @@ function handleLogout() { session_commit(); session_id($session_id_to_destroy); // switches to that session session_start(); - $_SESSION = array(); // effectively ends the session + $_SESSION = []; // effectively ends the session } } } From 5c039975fda2ae4b3152deee2c76e945110e29c1 Mon Sep 17 00:00:00 2001 From: Jason Gill Date: Fri, 29 Dec 2023 19:08:03 -0500 Subject: [PATCH 3/3] remove redundant addScope call from documentation --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 5b6e8587..7ea06e16 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,6 @@ $oidc = new OpenIDConnectClient('https://id.provider.com', 'ClientIDHere', 'ClientSecretHere'); $oidc->setResponseTypes(['id_token']); -$oidc->addScope(['openid']); $oidc->setAllowImplicitFlow(true); $oidc->addAuthParam(['response_mode' => 'form_post']); $oidc->setCertPath('/path/to/my.cert');