Skip to content

Make the offline_access scope of the entry point optional - #67

Merged
robertlemke merged 3 commits into
flownative:mainfrom
gerdemann:patch-1
Sep 11, 2026
Merged

robertlemke merged 3 commits into
flownative:mainfrom
gerdemann:patch-1

Conversation

@gerdemann

@gerdemann gerdemann commented Mar 28, 2025

Copy link
Copy Markdown
Contributor

The entry point requests the offline_access scope by default, so that an expired identity token can be refreshed. The new entry point option requestRefreshToken: false turns this off.

Identity providers handle this scope differently. Auth0 and Microsoft Entra ID need it to issue a refresh token. Google rejects it with an invalid_scope error. Keycloak issues an offline token which does not expire with the SSO session. The default stays, so installations which rely on token refresh keep working.

Also fixes the README example, which used a scopes option the entry point does not read.

gerdemann and others added 3 commits March 28, 2025 22:25
The scope offline_access is not always necessary or useful.
The entry point requests "offline_access" by default, so that an
expired identity token can be refreshed. The new entry point option
"requestRefreshToken" turns this off.

Not every identity provider handles this scope the same way. Auth0
and Microsoft Entra ID need it to issue a refresh token. Google
rejects it with an "invalid_scope" error, so a login with Google
failed completely. Keycloak issues an offline token which does not
expire with the SSO session.

Removing the scope for everyone would silently disable token refresh
for all installations which rely on it. The default therefore stays
as it is.

The README example used a "scopes" option which the entry point does
not read. It now uses "scope".
@robertlemke robertlemke changed the title Remove default scope 'offline_access' Make the offline_access scope of the entry point optional Sep 11, 2026
@robertlemke

robertlemke commented Sep 11, 2026

Copy link
Copy Markdown
Member

Thanks for the PR, and sorry for the long wait! Removing offline_access altogether would have silently disabled token refresh (#66) for everyone relying on it, for example with Auth0 or Entra ID, which only issue refresh tokens with that scope. So I kept the default and added an entry point option instead:

entryPointOptions:
  serviceName: 'yourService'
  requestRefreshToken: false

With that, only openid is added to your configured scope. I pushed this to your branch. Would this work for your setup?

@robertlemke
robertlemke merged commit e832b48 into flownative:main Sep 11, 2026
8 checks passed
@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 37.50000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 23.99%. Comparing base (57838b7) to head (b51802e).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
Classes/Authentication/OpenIdConnectEntryPoint.php 0.00% 3 Missing ⚠️
Classes/OpenIdConnectClient.php 60.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main      #67      +/-   ##
============================================
+ Coverage     23.64%   23.99%   +0.34%     
- Complexity      231      235       +4     
============================================
  Files            10       10              
  Lines           592      596       +4     
============================================
+ Hits            140      143       +3     
- Misses          452      453       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants