Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs for using custom audiences in Open ID Connect #2607

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 19 additions & 8 deletions src/pages/docs/octopus-rest-api/openid-connect/other-issuers.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ The first step is to create an OIDC identity for your issuer to access the Octop
1. The issuer URL must be HTTPS.
2. The URL should be the base where the OIDC Discovery endpoint (`/.well-known/openid-configuration`) endpoint can be found. For example if the discovery endpoint is `https://my-oidc-issuer.com/.well-known/openid-configuration` then the issuer should be set to `https://my-oidc-issuer.com`.
6. Enter the subject of the identity. This must match the subject that is provided in the OIDC token and is _case-sensitive_, wildcards for matching multiple characters `*` and single characters `?` can be used. The format of the subject will differ by issuer, please consult your OIDC issuers documentation.
7. Click Save.
7. Optionally enter a custom audience of the identity if required.
8. Click Save.

:::div{.hint}
Multiple OIDC identities can be added for a service account.
:::

:::figure
![OIDC Identity for other issuer](/docs/octopus-rest-api/images/oidc-identity-other-issuer.png "width=500")
![OIDC Identity for other issuer](/docs/octopus-rest-api/images/oidc-identity-other-issuer.png 'width=500')
:::

## OpenID discovery endpoints
Expand Down Expand Up @@ -94,12 +95,12 @@ If the request is not successful, the response will contain the following proper

The OIDC token must conform to the [JSON Web Token](https://datatracker.ietf.org/doc/html/rfc7519) standard and contain the following claims:

| Claim | Value | Example |
| ----- | ----------------------------------------------------------------------------------- | ------------------------------------ |
| `iss` | The issuer of the token. This must match exactly the issuer on the OIDC identity. | https://my-oidc.issuer.com |
| `sub` | The subject of the token. This must match exactly the subject on the OIDC identity. | scope:a-scope-to-restrict-the-usage |
| `aud` | The id of the service account to exchange the OIDC token for. | 863b4b7d-6308-456e-8375-8d9270e9be44 |
| `exp` | The expiration time of the token. The token must not be expired. | 1632493567 |
| Claim | Value | Example |
| ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
| `iss` | The issuer of the token. This must match exactly the issuer on the OIDC identity. | https://my-oidc.issuer.com |
| `sub` | The subject of the token. This must match exactly the subject on the OIDC identity. | scope:a-scope-to-restrict-the-usage |
| `aud` | The audience of the token. This must match exactly the audience on the OIDC identity. Generally this will be the id of the service account to exchange the OIDC token for. | 863b4b7d-6308-456e-8375-8d9270e9be44 |
| `exp` | The expiration time of the token. The token must not be expired. | 1632493567 |

The OIDC token must be signed by the issuer, with the signature included as part of the token payload.

Expand All @@ -111,6 +112,16 @@ To use the access token as authentication for a request to the Octopus API, it m
Authorization: Bearer {the-access-token-obtained-from-octopus}
```

## Custom audience

Some issuers may not be able to generate an OIDC token with the id of the Octopus service account set in the audience (`aud`) field. Examples of this include when connecting to Octopus from a custom application running in Azure.

When configuring an OIDC identity for an other issuer, the audience can be set to a custom string. Click the edit icon next to the Audience field to do this.

:::figure
![OIDC Identity with custom audience](/docs/octopus-rest-api/images/oidc-identity-other-issuer-custom-audience.png 'width=500')
:::

## Older Versions

- Support for wildcards when matching a subject was added in Octopus 2024.1.
Loading