22using Microsoft . AspNetCore . Builder ;
33using Microsoft . AspNetCore . Identity ;
44using Microsoft . EntityFrameworkCore ;
5- using Microsoft . Extensions . DependencyInjection ;
6- using Microsoft . Extensions . DependencyInjection . Extensions ;
75using NetDevPack . Identity . Data ;
86using NetDevPack . Identity . Interfaces ;
97using NetDevPack . Identity . Jwt ;
10- using NetDevPack . Security . Jwt . Core ;
118using NetDevPack . Security . Jwt . Core . Interfaces ;
129
1310namespace Microsoft . Extensions . DependencyInjection ;
@@ -32,23 +29,24 @@ public static IJwksBuilder AddNetDevPackIdentity(this IServiceCollection service
3229 services . AddScoped < IJwtBuilder , JwtBuilderInject < IdentityUser , string > > ( ) ;
3330 return services . AddHttpContextAccessor ( ) . AddJwksManager ( ) ;
3431 }
35-
32+
3633 public static IdentityBuilder AddIdentityConfiguration ( this IServiceCollection services )
3734 {
3835 if ( services == null ) throw new ArgumentException ( nameof ( services ) ) ;
3936 services . AddNetDevPackIdentity ( ) ;
4037
41- return services . AddIdentityCore < IdentityUser > ( )
42- . AddRoles < IdentityRole > ( )
43- . AddEntityFrameworkStores < NetDevPackAppDbContext > ( )
44- . AddDefaultTokenProviders ( ) ;
38+ return services
39+ . AddIdentity < IdentityUser , IdentityRole > ( )
40+ . AddEntityFrameworkStores < NetDevPackAppDbContext > ( )
41+ . AddDefaultTokenProviders ( ) ;
4542 }
4643
4744 public static IdentityBuilder AddDefaultIdentity ( this IServiceCollection services , Action < IdentityOptions > options = null )
4845 {
4946 if ( services == null ) throw new ArgumentException ( nameof ( services ) ) ;
5047 services . AddNetDevPackIdentity < IdentityUser > ( ) ;
51- return services . AddIdentityCore < IdentityUser > ( options )
48+ return services
49+ . AddIdentity < IdentityUser , IdentityRole > ( )
5250 . AddDefaultTokenProviders ( ) ;
5351 }
5452
@@ -57,7 +55,7 @@ public static IdentityBuilder AddCustomIdentity<TIdentityUser>(this IServiceColl
5755 {
5856 if ( services == null ) throw new ArgumentException ( nameof ( services ) ) ;
5957
60- return services . AddIdentityCore < TIdentityUser > ( options )
58+ return services . AddIdentity < TIdentityUser , IdentityRole > ( options )
6159 . AddDefaultTokenProviders ( ) ;
6260 }
6361
@@ -67,7 +65,7 @@ public static IdentityBuilder AddCustomIdentity<TIdentityUser, TKey>(this IServi
6765 {
6866 if ( services == null ) throw new ArgumentException ( nameof ( services ) ) ;
6967 services . AddNetDevPackIdentity < TIdentityUser , TKey > ( ) ;
70- return services . AddIdentityCore < TIdentityUser > ( options )
68+ return services . AddIdentity < TIdentityUser , IdentityRole < TKey > > ( options )
7169 . AddDefaultTokenProviders ( ) ;
7270 }
7371
0 commit comments