Skip to content

Support new JWT token based auth from openEO API 1.3#859

Open
niebl wants to merge 33 commits intoOpen-EO:masterfrom
niebl:jwt
Open

Support new JWT token based auth from openEO API 1.3#859
niebl wants to merge 33 commits intoOpen-EO:masterfrom
niebl:jwt

Conversation

@niebl
Copy link

@niebl niebl commented Feb 6, 2026

#850

Includes:

  • checking conformance in connection.authenticate_basic() and connection.authenticate_oidc() and formatting the bearer tokens accordingly
  • a /conformance endpoint in DummyBackend and a has_conformance({url}) method in capabilities. So JWT bearer token conformance can be checked.

@niebl
Copy link
Author

niebl commented Feb 6, 2026

still WIP, as testing with JWT conformant backends is not yet implemented (manual tests have shown that there is still something going wrong though)

niebl and others added 6 commits February 10, 2026 09:20
Co-authored-by: Matthias Mohr <m.mohr@moregeo.it>
Co-authored-by: Matthias Mohr <m.mohr@moregeo.it>
Co-authored-by: Matthias Mohr <m.mohr@moregeo.it>
niebl and others added 2 commits February 10, 2026 13:16
Co-authored-by: Matthias Mohr <m.mohr@moregeo.it>
@m-mohr m-mohr marked this pull request as ready for review February 10, 2026 13:44
Co-authored-by: Matthias Mohr <m.mohr@moregeo.it>
@m-mohr m-mohr linked an issue Feb 10, 2026 that may be closed by this pull request
@m-mohr m-mohr requested a review from soxofaan February 10, 2026 14:04
Copy link
Member

@soxofaan soxofaan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, thanks for this effort

some notes:

assert capabilities.has_conformance("https://api.openeo.org/*/authentication/jwt") == True
assert conn.auth.bearer == oidc_mock.state["access_token"]
# TODO: check issuer ("iss") value in parsed jwt. this will require the example jwt to be formatted accordingly
assert refresh_token_store.mock_calls == []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of duplicating tests for JWT conformace mode (like this single test_authenticate_oidc_auth_code_pkce_flow), I think we should look instead into parameterizing all existing tests here.

e.g. there are 41 occurrences of assert.*bearer.*oidc/ in this file, so there is a lot of test coverage that should be ported to JWT conformance mode (as it is meant to become the default/recommended approach)

Copy link
Author

@niebl niebl Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @soxofaan,
that's a lot of test coverage.
1d5c20f now uses both 1.0.0 and 1.3.0 versions as parameters.

There are still five failing tests under version 1.3.0, namely the tests from test_authenticate_oidc_auto_renew_expired_access_token_invalid_refresh_token to test_authenticate_oidc_auto_renew_expired_access_token_initial_device_code

All of these have in common that they use the get_me_handler to extract access token and oidc_provider from the bearer token. This could be changed to extract the oicd provider from the iss issuer-attribute in the jwt, but afaik that is not yet included in the example bearer tokens and would need to be implemented first.

Should we change those parts of the code accordingly so the get_me_handler can also pick the oidc_provider from he token?

Copy link
Member

@soxofaan soxofaan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some more notes

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.

Support new JWT token based auth from openEO API 1.3

3 participants

Comments