Skip to content

Commit 4e76b76

Browse files
RolandGuijtRoland GuijtCopilotmaartenba
authored
Clarify introspection endpoint (#701)
* Clarify introspection endpoint * Update src/content/docs/identityserver/reference/endpoints/introspection.md Co-authored-by: Copilot <[email protected]> * Update src/content/docs/identityserver/reference/endpoints/introspection.md Co-authored-by: Copilot <[email protected]> * Update src/content/docs/identityserver/reference/endpoints/introspection.md Co-authored-by: Maarten Balliauw <[email protected]> * Update src/content/docs/identityserver/reference/endpoints/introspection.md Co-authored-by: Maarten Balliauw <[email protected]> * Update src/content/docs/identityserver/reference/endpoints/introspection.md Co-authored-by: Maarten Balliauw <[email protected]> --------- Co-authored-by: Roland Guijt <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Maarten Balliauw <[email protected]>
1 parent 58409c0 commit 4e76b76

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

src/content/docs/identityserver/reference/endpoints/introspection.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,20 @@ The introspection endpoint is an implementation of [RFC 7662](https://tools.ietf
1616
It can be used to validate reference tokens, JWTs (if the consumer does not have support for appropriate JWT or
1717
cryptographic libraries) and refresh tokens. Refresh tokens can only be introspected by the client that requested them.
1818

19-
The introspection endpoint requires authentication - since the client of an introspection endpoint is an API, you
20-
configure the secret on the `ApiResource`.
19+
The introspection endpoint requires authentication. Since the request to the introspection endpoint is typically done by an API, which is not an OAuth client, the [`ApiResource`](/identityserver/fundamentals/resources/api-resources) is used to configure credentials:
20+
21+
```csharp
22+
new ApiResource("resource1")
23+
{
24+
Scopes = { "scope1", "scope2" }, // Replace "scope1", "scope2" with the actual scopes required for your API
25+
26+
ApiSecrets =
27+
{
28+
new Secret("secret".Sha256())
29+
}
30+
}
31+
```
32+
Here the id used for authentication is the name of the `ApiResource`: "resource1" and the secret the configured secret. The introspection endpoint uses HTTP basic auth to communicate these credentials:
2133

2234
```text
2335
POST /connect/introspect
@@ -26,8 +38,7 @@ Authorization: Basic xxxyyy
2638
token=<token>
2739
```
2840

29-
A successful response will return a status code of 200, the token claims, the token type and a flag indicating the token
30-
is active:
41+
A successful response will return a status code of 200, the token claims, the token type, and a flag indicating the token is active:
3142

3243
```json
3344
{
@@ -66,9 +77,9 @@ var client = new HttpClient();
6677
var response = await client.IntrospectTokenAsync(new TokenIntrospectionRequest
6778
{
6879
Address = "https://demo.duendesoftware.com/connect/introspect",
69-
ClientId = "api1",
80+
ClientId = "resource1",
7081
ClientSecret = "secret",
7182

72-
Token = accessToken
83+
Token = "<PLACEHOLDER_TOKEN>" // Replace with the actual token
7384
});
7485
```

0 commit comments

Comments
 (0)