Skip to content

Commit ae1aa1c

Browse files
Merge pull request #821 from DuendeSoftware/ka/astro-5.12.1-upgrade
Upgrade dependencies and standardize code formatting
2 parents 8d88ee5 + 2c56ac8 commit ae1aa1c

File tree

4 files changed

+48
-27
lines changed

4 files changed

+48
-27
lines changed

package-lock.json

Lines changed: 15 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"type": "git",
1212
"url": "https://github.com/DuendeSoftware/docs.duendesoftware.com.git"
1313
},
14-
"notes" : {
15-
"Astro SVG validation issue" : "https://github.com/withastro/astro/issues/13006"
14+
"notes": {
15+
"Astro SVG validation issue": "https://github.com/withastro/astro/issues/13006"
1616
},
1717
"scripts": {
1818
"dev": "astro dev",
@@ -25,13 +25,13 @@
2525
"postinstall": "patch-package"
2626
},
2727
"dependencies": {
28-
"@astrojs/markdown-remark": "^6.3.2",
29-
"@astrojs/starlight": "^0.34.4",
28+
"@astrojs/markdown-remark": "^6.3.3",
29+
"@astrojs/starlight": "^0.35.1",
3030
"@astrojs/ts-plugin": "^1.10.4",
3131
"@fontsource/roboto": "^5.2.6",
3232
"@pasqal-io/starlight-client-mermaid": "^0.1.0",
3333
"@resvg/resvg-js": "^2.6.2",
34-
"astro": "^5.10.1",
34+
"astro": "^5.12.1",
3535
"astro-opengraph-images": "^1.13.1",
3636
"astro-redirect-from": "^1.3.3",
3737
"astro-rehype-relative-markdown-links": "^0.18.1",
File renamed without changes.

src/content/docs/identityserver/aspnet-identity/index.md

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ redirect_from:
1111

1212

1313
An ASP.NET Identity-based implementation is provided for managing the identity database for users of IdentityServer.
14-
This implementation implements the extensibility points in IdentityServer needed to load identity data for your users to emit claims into tokens.
14+
This implementation implements the extensibility points in IdentityServer needed to load identity data for your users to
15+
emit claims into tokens.
1516

1617
To use this library, ensure that you have the NuGet package for the ASP.NET Identity integration.
1718
It is called `Duende.IdentityServer.AspNetIdentity`.
@@ -21,7 +22,8 @@ You can install it with:
2122
dotnet add package Duende.IdentityServer.AspNetIdentity
2223
```
2324

24-
Next, configure ASP.NET Identity normally in your IdentityServer host with the standard calls to `AddIdentity` and any other related configuration.
25+
Next, configure ASP.NET Identity normally in your IdentityServer host with the standard calls to `AddIdentity` and any
26+
other related configuration.
2527

2628
Then in your `Program.cs`, use the `AddAspNetIdentity` extension method after the call to `AddIdentityServer`:
2729

@@ -35,13 +37,31 @@ builder.Services.AddIdentityServer()
3537
.AddAspNetIdentity<ApplicationUser>();
3638
```
3739

38-
`AddAspNetIdentity` requires as a generic parameter the class that models your user for ASP.NET Identity (and the same one passed to `AddIdentity` to configure ASP.NET Identity).
39-
This configures IdentityServer to use the ASP.NET Identity implementations of [IUserClaimsPrincipalFactory](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.identity.iuserclaimsprincipalfactory-1) to convert the user data into claims, `IResourceOwnerPasswordValidator` to support the [password grant type](/identityserver/tokens/password-grant/), and `IProfileService` which uses the `IUserClaimsPrincipalFactory` to add [claims](/identityserver/fundamentals/claims) to tokens.
40-
It also configures some of ASP.NET Identity's options for use with IdentityServer (such as claim types to use and authentication cookie settings).
40+
`AddAspNetIdentity` requires as a generic parameter the class that models your user for ASP.NET Identity (and the same
41+
one passed to `AddIdentity` to configure ASP.NET Identity).
42+
This configures IdentityServer to use the ASP.NET Identity implementations
43+
of [IUserClaimsPrincipalFactory](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.identity.iuserclaimsprincipalfactory-1)
44+
to convert the user data into claims, `IResourceOwnerPasswordValidator` to support
45+
the [password grant type](/identityserver/tokens/password-grant/), and `IProfileService`, which uses the
46+
`IUserClaimsPrincipalFactory` to add [claims](/identityserver/fundamentals/claims) to tokens.
47+
It also configures some of ASP.NET Identity's options for use with IdentityServer (such as claim types to use and
48+
authentication cookie settings).
4149

42-
If you need to use your own implementation of `IUserClaimsPrincipalFactory`, then that is supported. Our implementation of the `IUserClaimsPrincipalFactory` will use the decorator pattern to encapsulate yours. For this to work properly, ensure that your implementation is registered in the ASP.NET Core service provider prior to calling the IdentityServer `AddAspNetIdentity` extension method.
50+
If you need to use your own implementation of `IUserClaimsPrincipalFactory`, then that is supported. Our implementation
51+
of the `IUserClaimsPrincipalFactory` will use the decorator pattern to encapsulate yours. For this to work correctly,
52+
ensure that your implementation is registered in the ASP.NET Core service provider before calling the IdentityServer
53+
`AddAspNetIdentity` extension method.
4354

44-
The `IUserProfileService` interface has two methods that IdentityServer uses to interact with the user store. The profile service added for ASP.NET Identity implements `GetProfileDataAsync` by invoking the `IUserClaimsPrincipalFactory` implementation registered in the dependency injection container. The other method on `IProfileService` is `IsActiveAsync` which is used in various places in IdentityServer to validate that the user is (still) active. There is no built-in concept in ASP.NET Identity to inactive users, so our implementation is hard coded to return `true`. If you extend the ASP.NET Identity user with enabled/disabled functionality you should derive from our `ProfileService<TUser>` and override *IsUserActiveAsync(TUser user)* to check your custom enabled/disabled flags.
55+
The `IUserProfileService` interface has two methods that IdentityServer uses to interact with the user store. The
56+
profile service added for ASP.NET Identity implements `GetProfileDataAsync` by invoking the
57+
`IUserClaimsPrincipalFactory` implementation registered in the dependency injection container. The other method on
58+
`IProfileService` is `IsActiveAsync`, which is used in various places in IdentityServer to validate that the user is (
59+
still) active. There is no built-in concept in ASP.NET Identity to inactive users, so our implementation is hard-coded
60+
to return `true`. If you extend the ASP.NET Identity user with enabled/disabled functionality, you should derive from
61+
our `ProfileService<TUser>` and override `IsUserActiveAsync(TUser user)` to check your custom enabled/disabled flags.
4562

4663
## Template
47-
Alternatively, you can use the `isaspid` [template](/identityserver/overview/packaging#templates) to create a starter IdentityServer host project configured to use ASP.NET Identity. See the [Quickstart Documentation](/identityserver/quickstarts/5-aspnetid/) for a detailed walkthrough.
64+
65+
Alternatively, you can use the `isaspid` [template](/identityserver/overview/packaging#templates) to create a starter
66+
IdentityServer host project configured to use ASP.NET Identity. See
67+
the [Quickstart Documentation](/identityserver/quickstarts/5-aspnetid/) for a detailed walkthrough.

0 commit comments

Comments
 (0)