- 🇦🇺Australia seamus_lee
Thanks for the work @polynya and @aneek
One thing I was noticing when comparing the previous set of changes is that I don't think the offline access was set up correctly and I think this solves the issue as per https://auth0.com/docs/secure/tokens/refresh-tokens/get-refresh-tokens you need to specify offline_access in the scopes if your permitting offline access
```
diff --git a/src/Controller/AuthController.php b/src/Controller/AuthController.php
index 1a93a6f..95d389c 100644
--- a/src/Controller/AuthController.php
+++ b/src/Controller/AuthController.php
@@ -231,7 +231,7 @@ class AuthController extends ControllerBase {
$this->redirectForSso = (bool) $this->config->get(AuthController::AUTH0_REDIRECT_FOR_SSO);
$this->offlineAccess = (bool) $this->config->get(AuthController::AUTH0_OFFLINE_ACCESS);
$this->currentRequest = $request_stack->getCurrentRequest();
-
+ $scopes = explode(' ', AUTH0_DEFAULT_SCOPES);
$sdk_configuration = new SdkConfiguration([
'domain' => $this->helper->getAuthDomain(),
'clientId' => $this->clientId,
@@ -239,6 +239,7 @@ class AuthController extends ControllerBase {
'cookieSecret' => $this->cookieSecret,
'redirectUri' => "$base_url/auth0/callback",
'persistUser' => FALSE,
+ 'scope' => ($this->offlineAccess ? array_merge($scopes, ['offline_access']) : $scopes),
]);
$transient_store = new SessionStore($sdk_configuration);
$sdk_configuration->setTransientStorage($transient_store);
``` - 🇦🇺Australia seamus_lee
Just flagging that I have tested this with the change I mentioned above on a client site and login works successfully. One thing I would suggest is that this should probably be done as a 4.x version given the change in the SDK version and also we need to highlight in the release notes that the auth0_cookie_secret needs to be configured probably prior to the upgrade otherwise can get a fatal error
- First commit to issue fork.
- 41d0b32f committed on 3.x
Issue #3317233 by seamus_lee: deal with offline_access scope
- 41d0b32f committed on 3.x
- 754ead01 committed on 3.x
Issue #3317233 by grota: create random secret in hook_update_N and in...
- 754ead01 committed on 3.x
- 08c26084 committed on 3.x
Issue #3317233 by polynya: Add return parameter for logout, defaults to...
- 08c26084 committed on 3.x
- 9db1a12d committed on 3.x
Issue #3317233 by polynya: Redirect does not always occur so force it...
- 9db1a12d committed on 3.x
- a71b81e8 committed on 3.x
Issue #3317233 by polynya: Update module to use auth0/auth0-php version...
- a71b81e8 committed on 3.x
- Status changed to Fixed
over 1 year ago 3:26pm 9 June 2023 - 🇪🇸Spain grota
Thank you @polynya and @seamus_lee! I rebased MR3 and adding also the bit about the offlines scopes and a contribution from me to fill the cookie secret in a hook_update_N and hook_install.
I kept the commits unsquashed credit where credit is due. Automatically closed - issue fixed for 2 weeks with no activity.