Skip to content

Commit 0774d2c

Browse files
Fix namespaces for IdentityModel.
1 parent eb71121 commit 0774d2c

10 files changed

Lines changed: 52 additions & 38 deletions

File tree

src/content/docs/identityserver/quickstarts/1-client-credentials.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,9 @@ endpoint addresses can be read from the metadata. Add the following to the
380380
client's Program.cs in the `src/Client/Program.cs` directory:
381381

382382
```cs
383-
using IdentityModel.Client;
383+
using Duende.IdentityModel.Client;
384384

385-
// discover endpoints from metadata
385+
// discovery endpoints from metadata
386386
var client = new HttpClient();
387387
var disco = await client.GetDiscoveryDocumentAsync("https://localhost:5001");
388388
if (disco.IsError)

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ required to implement the `IBackchannelAuthenticationUserValidator` interface.
8383

8484
instead of providing all parameters as individual parameters, you can provide all them as a JWT
8585

86-
```text
86+
```http request
8787
POST /connect/ciba
8888
8989
client_id=client1&
@@ -94,7 +94,7 @@ POST /connect/ciba
9494

9595
And a successful response will look something like:
9696

97-
```text
97+
```http request
9898
HTTP/1.1 200 OK
9999
Content-Type: application/json
100100
Cache-Control: no-store
@@ -108,11 +108,11 @@ Cache-Control: no-store
108108

109109
## .NET Client Library
110110

111-
You can use the [Duende IdentityModel](../../../identitymodel) client library to programmatically interact with
111+
You can use the [Duende IdentityModel](/identitymodel/index.mdx) client library to programmatically interact with
112112
the protocol endpoint from .NET code.
113113

114114
```cs
115-
using IdentityModel.Client;
115+
using Duende.IdentityModel.Client;
116116

117117
var client = new HttpClient();
118118

src/content/docs/identityserver/reference/endpoints/device-authorization.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ POST /connect/deviceauthorization
3636

3737
## .NET Client Library
3838

39-
You can use the [Duende IdentityModel](../../../identitymodel) client library to programmatically interact with
39+
You can use the [Duende IdentityModel](/identitymodel/index.mdx) client library to programmatically interact with
4040
the protocol endpoint from .NET code.
4141

4242
```cs
43-
using IdentityModel.Client;
43+
using Duende.IdentityModel.Client;
4444

4545
var client = new HttpClient();
4646

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ An invalid request will return a 400, an unauthorized request 401.
5555

5656
## .NET Client Library
5757

58-
You can use the [Duende IdentityModel](../../../identitymodel) client library to programmatically interact with
58+
You can use the [Duende IdentityModel](/identitymodel/index.mdx) client library to programmatically interact with
5959
the protocol endpoint from .NET code.
6060

6161
```cs
62-
using IdentityModel.Client;
62+
using Duende.IdentityModel.Client;
6363

6464
var client = new HttpClient();
6565

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ token=...&token_type_hint=refresh_token
3333

3434
## .NET Client Library
3535

36-
You can use the [Duende IdentityModel](../../../identitymodel) client library to programmatically interact with
36+
You can use the [Duende IdentityModel](/identitymodel/index.mdx) client library to programmatically interact with
3737
the protocol endpoint from .NET code.
3838

3939
```cs
40-
using IdentityModel.Client;
40+
using Duende.IdentityModel.Client;
4141

4242
var client = new HttpClient();
4343

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ CONTENT-TYPE application/x-www-form-urlencoded
100100

101101
## .NET Client Library
102102

103-
You can use the [Duende IdentityModel](../../../identitymodel) client library to programmatically interact with
103+
You can use the [Duende IdentityModel](/identitymodel/index.mdx) client library to programmatically interact with
104104
the protocol endpoint from .NET code.
105105

106106
```cs
107-
using IdentityModel.Client;
107+
using Duende.IdentityModel.Client;
108108

109109
var client = new HttpClient();
110110

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

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,31 @@ Content-Type: application/json
3737

3838
## .NET Client Library
3939

40-
You can use the [Duende IdentityModel](../../../identitymodel) client library to programmatically interact with
40+
You can use the [Duende IdentityModel](/identitymodel/index.mdx) client library to programmatically interact with
4141
the protocol endpoint from .NET code.
4242

4343
```cs
44-
using IdentityModel.Client;
44+
using Duende.IdentityModel.Client;
4545

4646
var client = new HttpClient();
4747

48-
var response = await client.GetUserInfoAsync(new UserInfoRequest
48+
var disco = await client.GetDiscoveryDocumentAsync("https://localhost:5001");
49+
50+
var token = await client.RequestAuthorizationCodeTokenAsync(new AuthorizationCodeTokenRequest
51+
{
52+
Address = disco.TokenEndpoint,
53+
54+
ClientId = "client",
55+
ClientSecret = "secret",
56+
57+
Code = "...",
58+
CodeVerifier = "...",
59+
RedirectUri = "https://app.com/callback"
60+
});
61+
62+
var userInfo = await client.GetUserInfoAsync(new UserInfoRequest
4963
{
5064
Address = disco.UserInfoEndpoint,
51-
Token = token
65+
Token = token.AccessToken
5266
});
5367
```

src/content/docs/identityserver/tokens/client-authentication.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ The following secret parsers are part of Duende IdentityServer:
8686

8787

8888
### Secret Validation
89-
It is the job of implementations of the [ISecretValidator](/identityserver/reference/models/secrets#duendeidentityservermodelparsedsecret) interface to validate the extracted credentials.
89+
It is the job of implementations of the [ISecretValidator](/identityserver/reference/models/secrets.md#duendeidentityservermodelparsedsecret) interface to validate the extracted credentials.
9090

9191
You can add secret validators by calling the `AddSecretValidator()` service provider extension method.
9292

@@ -154,7 +154,7 @@ var compromisedSecret = new Secret("just for demos, not prod!".Sha256());
154154

155155
You can either send the client id/secret combination as part of the POST body::
156156

157-
```
157+
```http request
158158
POST /connect/token
159159
160160
Content-type: application/x-www-form-urlencoded
@@ -169,7 +169,7 @@ Content-type: application/x-www-form-urlencoded
169169

170170
...or as a basic authentication header::
171171

172-
```
172+
```http request
173173
POST /connect/token
174174
175175
Content-type: application/x-www-form-urlencoded
@@ -182,11 +182,11 @@ Authorization: Basic xxxxx
182182

183183
### .NET Client Library
184184

185-
You can use the [Duende IdentityModel](../../../identitymodel) client library to programmatically interact with
185+
You can use the [Duende IdentityModel](/identitymodel/index.mdx) client library to programmatically interact with
186186
the protocol endpoint from .NET code.
187187

188188
```cs
189-
using IdentityModel.Client;
189+
using Duende.IdentityModel.Client;
190190

191191
var client = new HttpClient();
192192

@@ -253,7 +253,7 @@ You can share the same key for client authentication and [signed authorize reque
253253

254254
On the client side, the caller must first generate the JWT, and then send it on the `assertion` body field:
255255

256-
```
256+
```http request
257257
POST /connect/token
258258
259259
Content-type: application/x-www-form-urlencoded
@@ -299,7 +299,7 @@ private static string CreateClientToken(SigningCredentials credential, string cl
299299
protocol endpoint from .NET code.
300300

301301
```cs
302-
using IdentityModel.Client;
302+
using Duende.IdentityModel.Client;
303303

304304
static async Task<TokenResponse> RequestTokenAsync(SigningCredentials credential)
305305
{

src/content/docs/identityserver/tokens/refresh.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ access token. This can be done with an API call and does not require any user in
1717

1818
Since this is a privileged operation, the clients needs to be explicitly authorized to be able to use refresh tokens by
1919
setting the `AllowOfflineAccess` property to `true`. See
20-
the [client reference](/identityserver/reference/models/client#refresh-token) section for additional refresh token
20+
the [client reference](/identityserver/reference/models/client.md#refresh-token) section for additional refresh token
2121
related settings.
2222

2323
Refresh tokens are supported for the following flows: authorization code, hybrid and resource owner password credential
@@ -45,11 +45,11 @@ POST /connect/token
4545

4646
#### .NET Client Library
4747

48-
On .NET you can leverage the [Duende IdentityModel](../../../identitymodel) client library
49-
to [request](../../../identitymodel/endpoints/token) refresh tokens, e.g.:
48+
On .NET you can leverage the [Duende IdentityModel](/identitymodel/index.mdx) client library
49+
to [request](/identitymodel/endpoints/token.md) refresh tokens, e.g.:
5050

5151
```cs
52-
using IdentityModel.Client;
52+
using Duende.IdentityModel.Client;
5353

5454
var client = new HttpClient();
5555

@@ -77,7 +77,7 @@ are issued to and the client is required to authenticate itself in order to do s
7777
token issued to a confidential client cannot use it without the client's credentials.
7878

7979
Refresh tokens issued to public clients are not bound to the client in the same way, since the client cannot
80-
authenticate itself. We recommend that such refresh tokens be sender-constrained using [Proof of Possession](/identityserver/tokens/pop/)
80+
authenticate itself. We recommend that such refresh tokens be sender-constrained using [Proof of Possession](/identityserver/tokens/pop.md)
8181
instead.
8282

8383
You can further reduce the attack surface of refresh tokens using the following techniques.
@@ -124,7 +124,7 @@ to produce a new token, but the response containing the new refresh token is los
124124
application has no way to recover without the user logging in again. Reusable refresh tokens do not have this problem.
125125

126126
Reusable tokens may have better performance in
127-
the [persisted grants store](/identityserver/reference/stores/persisted-grant-store/). One-time use refresh tokens
127+
the [persisted grants store](/identityserver/reference/stores/persisted-grant-store.md). One-time use refresh tokens
128128
require additional records to be written to the store whenever a token is refreshed. Using reusable refresh tokens
129129
avoids those writes.
130130

@@ -175,4 +175,4 @@ replay detection. The `PersistentGrantOptions.DeleteOneTimeOnlyRefreshTokensOnUs
175175
used tokens persist and can be used to detect replays. The cleanup job should also be configured to not delete consumed
176176
tokens.
177177

178-
See also: The [IRefreshTokenService](/identityserver/reference/services/refresh-token-service/) reference.
178+
See also: The [IRefreshTokenService](/identityserver/reference/services/refresh-token-service.md) reference.

src/content/docs/identityserver/tokens/requesting.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ redirect_from:
1212
---
1313

1414
A typical architecture is composed of two application (aka
15-
client) [types](/identityserver/overview/terminology#client) - machine-to-machine calls and interactive applications.
15+
client) [types](/identityserver/overview/terminology.md#client) - machine-to-machine calls and interactive applications.
1616

1717
## Machine-to-machine Communication
1818

@@ -21,9 +21,9 @@ API.
2121

2222
Prerequisites are:
2323

24-
* define a [client](/identityserver/fundamentals/clients) for the *client credentials* grant type
25-
* define an [API scope](/identityserver/fundamentals/resources/api-scopes/) (and optionally a resource)
26-
* grant the client access to the scope via the [`AllowedScopes`](/identityserver/reference/models/client#basics)
24+
* define a [client](/identityserver/fundamentals/clients.md) for the *client credentials* grant type
25+
* define an [API scope](/identityserver/fundamentals/resources/api-scopes.md) (and optionally a resource)
26+
* grant the client access to the scope via the [`AllowedScopes`](/identityserver/reference/models/client.md#basics)
2727
property
2828

2929
According to the OAuth [specification](https://tools.ietf.org/html/rfc6749#section-4.4), you request a token by posting
@@ -63,7 +63,7 @@ The above token request would look like this in C#:
6363

6464
```csharp
6565
// Program.cs
66-
using IdentityModel.Client;
66+
using Duende.IdentityModel.Client;
6767

6868
var client = new HttpClient();
6969

@@ -208,7 +208,7 @@ Pragma: no-cache
208208
```
209209

210210
:::note
211-
See the refresh token section for more information on how to deal with [refresh tokens](/identityserver/tokens/refresh).
211+
See the refresh token section for more information on how to deal with [refresh tokens](/identityserver/tokens/refresh.md).
212212
:::
213213

214214
### .NET Client Library

0 commit comments

Comments
 (0)