feat: add best effort attempt to revoke oauth access token in external auth provider (#19775)

Solves #15575
Adds OAuth access token revocation when unlinking external auth
provider. Due to revocation not being consistently implemented by
providers this is only best effort attempt. Unsuccessful revocation
won't influence link removal.
This commit is contained in:
Paweł Banaszewski
2025-09-19 16:27:02 +02:00
committed by GitHub
parent 0601cc8fa6
commit 439b041780
24 changed files with 629 additions and 69 deletions
+16 -3
View File
@@ -80,6 +80,7 @@ curl -X GET http://coder-server:8080/api/v2/external-auth/{externalauth} \
"id": 0
}
],
"supports_revocation": true,
"user": {
"avatar_url": "string",
"id": 0,
@@ -105,6 +106,7 @@ To perform this operation, you must be authenticated. [Learn more](authenticatio
```shell
# Example request using curl
curl -X DELETE http://coder-server:8080/api/v2/external-auth/{externalauth} \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
```
@@ -116,11 +118,22 @@ curl -X DELETE http://coder-server:8080/api/v2/external-auth/{externalauth} \
|----------------|------|----------------|----------|-----------------|
| `externalauth` | path | string(string) | true | Git Provider ID |
### Example responses
> 200 Response
```json
{
"token_revocation_error": "string",
"token_revoked": true
}
```
### Responses
| Status | Meaning | Description | Schema |
|--------|---------------------------------------------------------|-------------|--------|
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | |
| Status | Meaning | Description | Schema |
|--------|---------------------------------------------------------|-------------|----------------------------------------------------------------------------------------------|
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.DeleteExternalAuthByIDResponse](schemas.md#codersdkdeleteexternalauthbyidresponse) |
To perform this operation, you must be authenticated. [Learn more](authentication.md).