Skip to content

Commit ff16451

Browse files
committed
Migrate from openEO-specific tokens to JWT #558
1 parent 85a0e9a commit ff16451

File tree

2 files changed

+50
-32
lines changed

2 files changed

+50
-32
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
- Added `version` property to `GET /processes` [#517](https://github.com/Open-EO/openeo-api/issues/517)
1616
- Added `queued`, `started` and `unpublished` to the batch job metadata and the corresponding STAC results [#542](https://github.com/Open-EO/openeo-api/issues/542)
1717
- Added all the batch job timestamps (including the new timestamps above) to the Collection type of batch job results
18+
- Support for JWT-based Bearer tokens [#558](https://github.com/Open-EO/openeo-api/issues/558)
19+
20+
### Deprecated
21+
22+
- Deprecated the openEO-specific Bearer token format (authentication mechanism/provider id/access token) [#558](https://github.com/Open-EO/openeo-api/issues/558)
23+
24+
### Changed
25+
26+
- Migrate from openEO-specific tokens to JWT [#558](https://github.com/Open-EO/openeo-api/issues/558)
1827

1928
### Fixed
2029

openapi.yaml

Lines changed: 41 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1884,18 +1884,7 @@ paths:
18841884
openEO clients MUST use the **access token** as part of the Bearer token
18851885
for authorization in subsequent API calls (see also the information
18861886
about Bearer tokens in this document). Clients MUST NOT use the id token
1887-
or the authorization code. The access token provided by an OpenID Connect
1888-
Provider does not necessarily provide information about the issuer (i.e. the
1889-
OpenID Connect provider) and therefore a prefix MUST be added to the Bearer
1890-
Token sent in subsequent API calls to protected endpoints. The Bearer
1891-
Token sent to protected endpoints MUST consist of the authentication
1892-
method (here `oidc`), the provider ID and the access token itself. All
1893-
separated by a forward slash `/`. The provider ID corresponds to the
1894-
value specified for `id` for each provider in the response body of this
1895-
endpoint. The header in subsequent API calls for a provider with `id`
1896-
`ms` would look as follows: `Authorization: Bearer oidc/ms/TOKEN`
1897-
(replace `TOKEN` with the actual access token received from the OpenID
1898-
Connect Provider).
1887+
or the authorization code.
18991888
19001889
Back-ends MAY request user information ([including Claims](https://openid.net/specs/openid-connect-core-1_0.html#Claims))
19011890
from the [OpenID Connect Userinfo endpoint](https://openid.net/specs/openid-connect-core-1_0.html#UserInfo)
@@ -1941,7 +1930,7 @@ paths:
19411930
issuer:
19421931
type: string
19431932
format: uri
1944-
description: >-
1933+
description: |-
19451934
The [issuer location](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfig)
19461935
(also referred to as 'authority' in some client libraries) is the URL of the
19471936
OpenID Connect provider, which conforms to a set of rules:
@@ -1955,7 +1944,6 @@ paths:
19551944
OpenID Connect.
19561945
19571946
2. The URL MUST NOT contain a terminating forward slash `/`.
1958-
19591947
example: 'https://accounts.google.com'
19601948
scopes:
19611949
type: array
@@ -2097,27 +2085,20 @@ paths:
20972085
get:
20982086
summary: HTTP Basic authentication
20992087
operationId: authenticate-basic
2100-
description: >-
2088+
description: |-
21012089
Checks the credentials provided through [HTTP Basic Authentication
2102-
according to RFC 7617](https://www.rfc-editor.org/rfc/rfc7617.html) and returns
2103-
an access token for valid credentials.
2104-
2090+
according to RFC 7617](https://www.rfc-editor.org/rfc/rfc7617.html) and
2091+
returns an access token in exchange for providing valid credentials.
21052092
21062093
The credentials (username and password) MUST be sent in the HTTP header
21072094
`Authorization` with type `Basic` and the Base64 encoded string
21082095
consisting of username and password separated by a double colon `:`. The
21092096
header would look as follows for username `user` and password `pw`:
21102097
`Authorization: Basic dXNlcjpwdw==`.
21112098
2112-
21132099
The access token has to be used in the Bearer token for authorization in
21142100
subsequent API calls (see also the information about Bearer tokens in
2115-
this document). The access token returned by this request MUST NOT be
2116-
provided with `basic//` prefix, but the Bearer Token sent in subsequent
2117-
API calls to protected endpoints MUST be prefixed with `basic//`. The
2118-
header in subsequent API calls would look as follows: `Authorization:
2119-
Bearer basic//TOKEN` (replace `TOKEN` with the actual access token).
2120-
2101+
this document).
21212102
21222103
It is RECOMMENDED to implement this authentication method for non-public
21232104
services only.
@@ -6809,13 +6790,41 @@ components:
68096790
type: http
68106791
scheme: bearer
68116792
bearerFormat: >-
6812-
The Bearer Token MUST consist of the authentication method, a provider
6813-
ID (if available) and the token itself. All separated by a forward slash
6814-
`/`. Examples (replace `TOKEN` with the actual access token): (1) Basic
6815-
authentication (no provider ID available): `basic//TOKEN` (2) OpenID
6816-
Connect (provider ID is `ms`): `oidc/ms/TOKEN`. For OpenID Connect, the
6817-
provider ID corresponds to the value specified for `id` for each
6818-
provider in `GET /credentials/oidc`.
6793+
Bearer tokens can be provided in two different ways:
6794+
6795+
1. **RECOMMENDED: JSON Web Token (JWT)**
6796+
6797+
The Bearer token is a [JWT](https://datatracker.ietf.org/doc/html/rfc7519)
6798+
as defined in RFC 7519. For openEO, it MUST include the issuer in the
6799+
`iss` claim although being optional in RFC 7519.
6800+
6801+
If this method is supported by the openEO implementation,
6802+
the server MUST provide the conformance class
6803+
`https://api.openeo.org/1.2.0/authentication/jwt`.
6804+
6805+
2. **DEPRECATED: openEO Tokens**
6806+
6807+
The Bearer Token is constructed from the authentication method, a
6808+
provider ID (if available) and the token itself. All separated by a
6809+
forward slash `/`.
6810+
6811+
Examples (replace `TOKEN` with the actual access token):
6812+
6813+
- Basic authentication (no provider ID available): `basic//TOKEN`
6814+
- OpenID Connect (provider ID is `ms`): `oidc/ms/TOKEN`.
6815+
For OpenID Connect, the provider ID corresponds to the value
6816+
specified for `id` for each provider in `GET /credentials/oidc`.
6817+
6818+
All servers must accept this method for backward compatibility
6819+
until version 2.0 of the specification.
6820+
6821+
The access tokens provided by the identity provider MUST NOT include
6822+
the prefix that includes the authentication method and provider ID.
6823+
The Bearer Token sent to the server MUST be prefixed with `basic//`.
6824+
This means that the clients have to prepend the prefix.
6825+
6826+
JWT and openEO tokens can be distinguished by the presence of a slash
6827+
`/` in the token, which JWT can never contain due to the Base64 encoding.
68196828
Basic:
68206829
type: http
68216830
scheme: basic

0 commit comments

Comments
 (0)