Skip to content

Commit ba6444c

Browse files
author
Roland Guijt
committed
Clarify introspection endpoint
1 parent 19eacff commit ba6444c

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

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+
```cs
22+
new ApiResource("resource1")
23+
{
24+
Scopes = { .. },
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 = dsf43534j33kkl..
7384
});
7485
```

0 commit comments

Comments
 (0)