File tree Expand file tree Collapse file tree 6 files changed +12
-8
lines changed
identityserver/quickstarts/javascript-clients Expand file tree Collapse file tree 6 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ Implementations of the *IAccessTokenRetriever* can be added to endpoints when th
112
112
``` cs
113
113
app .MapRemoteBffApiEndpoint (
114
114
" /api/impersonation" ,
115
- " https://api.example.com/endpoint/requiring/impersonation"
115
+ new Uri ( " https://api.example.com/endpoint/requiring/impersonation" )
116
116
).WithAccessToken (RequiredTokenType .User )
117
117
.WithAccessTokenRetriever <ImpersonationAccessTokenRetriever >();
118
118
```
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ The `MapRemoteBffApiEndpoint` extension method maps a path and all sub-paths bel
43
43
44
44
``` csharp
45
45
// Program.cs
46
- app .MapRemoteBffApiEndpoint (" /api/users" , " https://remoteHost/users" )
46
+ app .MapRemoteBffApiEndpoint (" /api/users" , new Uri ( " https://remoteHost/users" ) )
47
47
.WithAccessToken (RequiredTokenType .User );
48
48
```
49
49
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ This diagram shows this in more detail:
99
99
``` csharp
100
100
// setup on the server
101
101
102
- app .MapRemoteBffApiEndpoint (" /remote-apis/user-token" , " https://localhost:5010" )
102
+ app .MapRemoteBffApiEndpoint (" /remote-apis/user-token" , new Uri ( " https://localhost:5010" ) )
103
103
104
104
builder .Services .AddUserAccessTokenHttpClient (" callApi" ,
105
105
configureClient : client => client .BaseAddress = new Uri (" https://localhost:5010/" ));
Original file line number Diff line number Diff line change @@ -232,7 +232,7 @@ dotnet add package Duende.BFF.Yarp
232
232
```
233
233
234
234
{ /* prettier-ignore */ }
235
- <Tabs syncKey = " bffVersion " >
235
+ <Tabs >
236
236
{ /* prettier-ignore */ }
237
237
<TabItem label = " Direct forwarding" >
238
238
@@ -243,7 +243,7 @@ dotnet add package Duende.BFF.Yarp
243
243
// ...
244
244
245
245
// Map any call (including child routes) from /api/remote to https://remote-api-address
246
- app .MapRemoteBffApiEndpoint (" /api/remote" , " https://remote-api-address" )
246
+ app .MapRemoteBffApiEndpoint (" /api/remote" , new Uri ( " https://remote-api-address" ) )
247
247
.WithAccessToken (RequiredTokenType .Client );
248
248
```
249
249
Original file line number Diff line number Diff line change @@ -30,13 +30,17 @@ The syntax for configuring remote APIs has changed slightly:
30
30
31
31
``` diff lang="csharp" title="Program.cs"
32
32
// Use a client credentials token
33
- app.MapRemoteBffApiEndpoint("/api/client-token", "https://localhost:5010")
33
+ - app.MapRemoteBffApiEndpoint("/api/client-token", "https://localhost:5010")
34
34
- .RequireAccessToken(TokenType.Client);
35
+
36
+ + app.MapRemoteBffApiEndpoint("/api/client-token", new Uri("https://localhost:5010"))
35
37
+ .WithAccessToken(RequiredTokenType.Client);
36
38
37
39
// Use the client token only if the user is logged in
38
- app.MapRemoteBffApiEndpoint("/api/optional-user-token", "https://localhost:5010")
40
+ - app.MapRemoteBffApiEndpoint("/api/optional-user-token", "https://localhost:5010")
39
41
- .WithOptionalUserAccessToken();
42
+
43
+ + app.MapRemoteBffApiEndpoint("/api/optional-user-token", new Uri("https://localhost:5010"))
40
44
+ .WithAccessToken(RequiredTokenType.UserOrNone);
41
45
```
42
46
Original file line number Diff line number Diff line change @@ -463,7 +463,7 @@ API in the ASP.NET Core routing system. Add the code below to the endpoint confi
463
463
app .MapGet (" /local/identity" , LocalIdentityHandler )
464
464
.AsBffApiEndpoint ();
465
465
466
- app .MapRemoteBffApiEndpoint (" /remote" , " https://localhost:6001" )
466
+ app .MapRemoteBffApiEndpoint (" /remote" , new Uri ( " https://localhost:6001" ) )
467
467
.WithAccessToken (Duende .Bff .AccessTokenManagement .RequiredTokenType .User );
468
468
```
469
469
You can’t perform that action at this time.
0 commit comments