Repository navigation
mgr/dashboard: Improve oauth2 sso configuration - #67417
Conversation
|
Can one of the admins verify this patch? |
13 similar comments
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
rkachach
left a comment
There was a problem hiding this comment.
Thanks for the PR. Overall the changes LGTM just a couple of comments to be addressed for correctness.
There was a problem hiding this comment.
Pull request overview
This pull request improves OAuth2 SSO configuration for the Ceph Dashboard by:
- Fixing JTI claim handling: Resolves an authentication loop issue when OIDC providers don't send the jti claim in JWT tokens by improving debug logging to distinguish between missing jti claims and blocklisted tokens.
- Adding configuration options: Introduces
scopeandemail_domainsparameters to the oauth2-proxy service configuration, providing more control over OAuth2 authentication.
However, the PR contains several critical bugs that will prevent it from working correctly:
- Template variables are not properly passed in the context
- Incorrect validation applied to the scope field
- UI component mismatch for the scope field (uses list component instead of text input)
Changes:
- Improved jti claim handling in JWT token validation with better debug messages
- Added
scopeandemail_domainsfields to OAuth2ProxySpec - Updated Angular frontend to support new OAuth2 configuration fields
- Updated Jinja2 template to include scope and email_domains in oauth2-proxy configuration
- Enhanced test coverage for oauth2-proxy service configuration
- Added documentation about jti claim requirement
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/python-common/ceph/deployment/service_spec.py | Added scope and email_domains parameters to OAuth2ProxySpec, but validation for scope is incorrect (validates as URL) |
| src/pybind/mgr/dashboard/services/auth/auth.py | Improved JTI claim handling with separate debug messages for missing vs blocklisted tokens |
| src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.ts | Added form controls and data processing for scope and email_domains fields |
| src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.html | Added UI inputs for scope and email_domains, but uses wrong component type for scope |
| src/pybind/mgr/cephadm/tests/test_services.py | Updated tests to include new scope and email_domains parameters in oauth2-proxy test cases |
| src/pybind/mgr/cephadm/templates/services/oauth2-proxy/oauth2-proxy.conf.j2 | Added template logic for scope and email_domains, but references undefined context variables |
| doc/cephadm/services/oauth2-proxy.rst | Documented requirement for jti claim in JWT tokens |
Thanks for you quick review, PR adapted accordingly |
rkachach
left a comment
There was a problem hiding this comment.
Plz make sure the UT is passing by running:
tox -e py3 -- "cephadm/tests/test_services.py"
|
@webalexeu can you plz address the issues raised by @Pegonzal ? |
e286348 to
5c61681
Compare
Issues have been addressed (sorry for the delay). |
|
Thanks @webalexeu, let's wait for a last review from @Pegonzal. Once reviewed I'll tag the PR for Teuthology testing. |
There was a problem hiding this comment.
@webalexeu other than some issue with the ssl_insecure_skip_verify field on the frontend, the make check is failing due to some linting issue that needs to be fixed:
[lint:html ] [htmllint] found 0 errors out of 317 files
[lint:html ] All files pass linting
[lint:prettier] src/app/ceph/cluster/services/service-form/service-form.component.ts
[lint:eslint ]
[lint:eslint ] > nx run ceph-dashboard:lint
[lint:eslint ]
[lint:eslint ] Linting "ceph-dashboard"...
[lint:eslint ] All files pass linting.
[lint:eslint ]
[lint:eslint ]
[lint:eslint ]
[lint:eslint ] NX Successfully ran target lint for project ceph-dashboard
[lint:eslint ]
[lint:eslint ]
Try running 'npm run fix' to fix some linting errors. Some errors might need a manual fix.
Everything else looks good to me, thank you for the update!
|
jenkins retest this please |
2 similar comments
|
jenkins retest this please |
|
jenkins retest this please |
| <cd-text-label-list formControlName="scope" | ||
| label="Scope" | ||
| helperText="OAuth scope specification." | ||
| placeholder="openid profile email"> |
There was a problem hiding this comment.
Are you sure we want to put upperscale here as the value defined will be lower case ?
There was a problem hiding this comment.
I think should be fine as it is.
As can be found on the specification this is the standard way to write scope claims https://openid.net/specs/openid-connect-core-1_0.html#ScopeClaims
|
jenkins retest this please |
|
PR LGTM @webalexeu, however looks like there is a syntax error as can be seen in the make check failure: |
Hello, Sorry for the error, I've corrected accordingly |
|
jenkins test make check |
|
jenkins test make check arm64 |
|
@webalexeu seems like make check is still failing... The UT test file might needs some small adjustments:
|
|
Hey @webalexeu, just FYI ( as some linting issues might still be present): to verify that the dashboard changes are up to linting standards you can run: from
from
|
|
@webalexeu Dashboard UT is failing: plz follow instructions provided by @Pegonzal to fix it. |
Add possibility to configure email_domains and scope parameters in oauth2 sso configuration Fixes: https://tracker.ceph.com/issues/75020 mgr/dashboard: Fix oauth2 sso missing jti claim review Fixes: https://tracker.ceph.com/issues/75022 mgr/dashboard: Improve oauth2 sso configuration Add possibility to configure ssl_insecure_skip_verify parameter in oauth2 sso configuration Fixes: https://tracker.ceph.com/issues/75984 Signed-off-by: Alexandre Jardon <[email protected]>
Locally, it is all green so I don't know what is blocking ?
|
|
jenkins test make check arm64 |
|
@Pegonzal @anthonyeleven are the changes corresponding to you areas good to go? |
|
Teuthology run was successful. Failing Test cases are not related to this PR: https://pulpito.ceph.com/rkachach-2026-04-29_15:06:59-orch:cephadm-wip-rkachach-testing-2-2026-04-29-1255-distro-default-trial/ |
Pegonzal
left a comment
There was a problem hiding this comment.
LGTM, thanks for the contribution @webalexeu !
|
This is an automated message by src/script/redmine-upkeep.py. I have resolved the following tracker ticket due to the merge of this PR: No backports are pending for the ticket. If this is incorrect, please update the tracker |
|
This is an automated message by src/script/redmine-upkeep.py. I have resolved the following tracker ticket due to the merge of this PR: No backports are pending for the ticket. If this is incorrect, please update the tracker |
[mgr/dashboard: Fix oauth2 sso missing jti claim]
When using oauth2 sso configuration, if the OIDC provider doesn't send jti claim in the JWT token, the auhtentication is looping because the token is considered as block-listed
Improving debugging and documentation
Fixes: https://tracker.ceph.com/issues/75022
Signed-off-by: Alexandre Jardon [email protected]
[mgr/dashboard: Improve oauth2 sso configuration]
Add possibility to configure email_domains and scope parameters in oauth2 sso configuration
Fixes: https://tracker.ceph.com/issues/75020
Signed-off-by: Alexandre Jardon [email protected]
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.