Skip to content

Commit 54d0365

Browse files
authored
Merge pull request #894 from DuendeSoftware/wca/map-inbound-claims-sample
Added small samples
2 parents 8ef7797 + 309f629 commit 54d0365

File tree

1 file changed

+25
-2
lines changed
  • src/content/docs/identityserver/troubleshooting

1 file changed

+25
-2
lines changed

src/content/docs/identityserver/troubleshooting/index.mdx

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,34 @@ When invoking `Challenge`, be sure to call `SignOutAsync` before returning the c
269269

270270
### Set SaveTokens to `false`
271271

272-
When dealing with external authentication, you may want to set `SaveTokens` to `false` when calling `AddOpenIdConnect` to avoid storing the tokens in the cookie. Storing these tokens may not be necessary for your use case and thus take up unnecessary space.
272+
When dealing with external authentication, you may want to set `SaveTokens` to `false` when calling `AddOpenIdConnect`
273+
to avoid storing the tokens in the cookie. Storing these tokens may not be necessary for your use case and take up unnecessary space.
274+
275+
```csharp {5}
276+
// Program.cs
277+
services.AddAuthentication()
278+
.AddOpenIdConnect(options =>
279+
{
280+
options.SaveTokens = false;
281+
});
282+
```
273283

274284
### Set MapInboundClaims to `false`
275285

276-
When dealing with external authentication, you may want to set `MapInboundClaims` to `false` when calling `AddOpenIdConnect` to avoid mapping the claims from the external provider to the local user. Microsoft's namespace for external claims is `http://schemas.microsoft.com/identity/claims/` is larger than the claim names used by OpenID Connect and can take up unnecessary space.
286+
When dealing with external authentication, you may want to set `MapInboundClaims` to `false` when calling `AddOpenIdConnect`
287+
to avoid mapping the claims from the external provider.
288+
289+
Microsoft's namespace for external claims is `http://schemas.microsoft.com/identity/claims/`, which is significantly larger
290+
than the claim names used by OpenID Connect and can take up unnecessary space.
291+
292+
```csharp {5}
293+
// Program.cs
294+
services.AddAuthentication()
295+
.AddOpenIdConnect(options =>
296+
{
297+
options.MapInboundClaims = false;
298+
});
299+
```
277300

278301
### Implement `OnTicketReceived` To Reduce Cookie Size
279302

0 commit comments

Comments
 (0)