Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
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
21 changes: 21 additions & 0 deletions docs/admin/integrations/oauth2-provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
CODER_EXPERIMENTS=oauth2
```

## Creating OAuth2 Applications

Check warning on line 37 in docs/admin/integrations/oauth2-provider.md

View workflow job for this annotation

GitHub Actions / lint-docs

Coder.GerundHeading

Heading starts with an -ing word ('Creating'); prefer the imperative ('Install') or the noun ('Installation'). See capitalization-and-punctuation.md#no-gerund-leading-headings.

### Method 1: Web UI

Expand Down Expand Up @@ -371,7 +371,7 @@
This is also how you remove clients that registered themselves while dynamic client registration was enabled.
Turning the setting off stops new registrations; it does not remove the ones already there.

## Testing and Development

Check warning on line 374 in docs/admin/integrations/oauth2-provider.md

View workflow job for this annotation

GitHub Actions / lint-docs

Coder.GerundHeading

Heading starts with an -ing word ('Testing'); prefer the imperative ('Install') or the noun ('Installation'). See capitalization-and-punctuation.md#no-gerund-leading-headings.

Coder provides comprehensive test scripts for OAuth2 development:

Expand Down Expand Up @@ -653,6 +653,27 @@
refresh token is not consumed, so a client that drops the parameter or asks for
less recovers without re-authorizing.

Coder now enforces the `scope` an application declared for itself when it self-registered through [Dynamic Client Registration](#dynamic-client-registration).
This affects only deployments that enabled Dynamic Client Registration and have an application that self-registered with a `scope`.
Dynamic Client Registration is disabled by default, so if you never enabled it, nothing changes for you.
Turning it back off does not clear the check: Coder validates the stored `scope` of an existing application whether or not registration is still allowed, so an application that self-registered before you turned the setting off is affected too.

Earlier versions of Coder accepted any `scope` at registration without checking it, and every token for that application had full access.
Coder now treats the registered `scope` as the list of scopes the application is allowed to request, as described under [Scopes](#scopes).
Applications that self-registered without a `scope`, and applications created through the web UI or the management API, have no scope list and are not affected; they continue to receive full access.

An affected application fails in the following ways:

- A request for a scope name this deployment does not offer fails with `invalid_scope`.
- If none of the registered names are offered, every authorization fails, even one that leaves `scope` out.
- Authorization codes issued before the upgrade fail at the token endpoint with `invalid_grant` until they expire.

For the full error details, refer to ["invalid_scope" returned to your callback](#invalid_scope-returned-to-your-callback) and ["invalid_grant" for a scope the deployment cannot mint](#invalid_grant-for-a-scope-the-deployment-cannot-mint).

To fix an affected application, the party that holds its `registration_access_token` updates the registration with `PUT /oauth2/clients/{client_id}`, so that `scope` lists only names from `scopes_supported` in `GET /.well-known/oauth-authorization-server`.
If that token is lost, register the application again.
A Coder administrator cannot change an application's registered `scope` from the web UI or the management API; only the self-registration path writes that value.

## Standards Compliance

This implementation follows established OAuth2 standards including
Expand Down
Loading