Class DanglIdentityAuthenticationExtensions
Extensions for using Dangl.Identity in Asp.Net Core apps
Inheritance
System.Object
DanglIdentityAuthenticationExtensions
Assembly: Dangl.Identity.Client.Mvc.dll
Syntax
public static class DanglIdentityAuthenticationExtensions : object
Methods
|
Improve this Doc
View Source
AddControllersWithDanglIdentity<TIdentityDbContext, TIdentityUser, TIdentityRole>(IServiceCollection, DanglIdentityServerConfiguration)
This registers and configures all Dangl.Identity client services
Declaration
public static IServiceCollection AddControllersWithDanglIdentity<TIdentityDbContext, TIdentityUser, TIdentityRole>(this IServiceCollection services, DanglIdentityServerConfiguration danglIdentityServerConfig)
where TIdentityDbContext : IdentityDbContext<TIdentityUser, TIdentityRole, Guid> where TIdentityUser : IdentityUser<Guid>, IDanglIdentityUser, new()
where TIdentityRole : IdentityRole<Guid>, new()
Parameters
Returns
| Type |
Description |
| IServiceCollection |
|
Type Parameters
| Name |
Description |
| TIdentityDbContext |
|
| TIdentityUser |
|
| TIdentityRole |
|
|
Improve this Doc
View Source
UseDanglIdentityJwtTokenAuthentication(IApplicationBuilder, String, String)
This middleware should be added early in the pipeline. It will run the Jwt authentication for every incoming
request. This middleware should only be used if UseDanglIdentityJwtAuthentication
is enabled, since then no default authentication scheme or policy is enabled. This middleware will check if a request
has a Jwt Bearer token from a valid issuer and only then try to challenge it. Otherwise, when configuring all known
Jwt authorities as possible authentication schemes, the default in ASP.NET Core would try to authenticate the tokens
against all known issues, thus logging many unsusccesful authentication requests.
For example, if two valid issues are configured and a request is incoming, it would try to match both. One would succeed
and authenticate the user, but the other would be logged as a failed authentication attempt.
Declaration
public static IApplicationBuilder UseDanglIdentityJwtTokenAuthentication(this IApplicationBuilder app, string danglIdentityBaseUri, string danglIdentityFallbackUri)
Parameters
| Type |
Name |
Description |
| IApplicationBuilder |
app |
|
| System.String |
danglIdentityBaseUri |
|
| System.String |
danglIdentityFallbackUri |
|
Returns
| Type |
Description |
| IApplicationBuilder |
|
|
Improve this Doc
View Source
UseDanglIdentityJwtTokenUserInfoUpdater(IApplicationBuilder)
This registers a middleware that takes care of updating user information from
Dangl.Identity Jwt tokens in the local Asp.Net Identity user store
Declaration
public static IApplicationBuilder UseDanglIdentityJwtTokenUserInfoUpdater(this IApplicationBuilder app)
Parameters
| Type |
Name |
Description |
| IApplicationBuilder |
app |
|
Returns
| Type |
Description |
| IApplicationBuilder |
|