Active directory 使用Active Directory登录时自动分配的ABP角色

Active directory 使用Active Directory登录时自动分配的ABP角色,active-directory,aspnetboilerplate,user-permissions,Active Directory,Aspnetboilerplate,User Permissions,我已经在我的项目中设置了Active Directory的使用 Configuration.Modules.Zero().UserManagement.ExternalAuthenticationSources.Add<SsoAuthenticationSource>(); 然后调用DefaultExternalAuthenticationSource.TryAuthenticationAsync方法,该方法已在SsoAuthenticationSource中重写 然后,基类Def

我已经在我的项目中设置了Active Directory的使用

Configuration.Modules.Zero().UserManagement.ExternalAuthenticationSources.Add<SsoAuthenticationSource>();
然后调用DefaultExternalAuthenticationSource.TryAuthenticationAsync方法,该方法已在SsoAuthenticationSource中重写

然后,基类DefaultExternalAuthenticationSource成功地在系统中创建了一个用户

我的问题是,用户被自动分配了管理员角色。我希望创建的用户没有角色,因为当我检查他们是什么广告组的一部分时,我将在代码中进一步处理角色分配

我已尝试重写DefaultExternalAuthenticationSource.CreateUserAsync方法,但出现以下错误:

Cannot insert explicit value for identity column in table 'AbpUsers' when IDENTITY_INSERT is set to OFF.

尽管我没有尝试为此输入值,因为_userManager.CreateAsync(user)方法可以处理此问题。

很抱歉无法回答您的问题,但我正在努力让Azure Active Directory在我的项目中正常工作。您使用的是免费入门模板还是零点一?也许你可以为我提供一些指导,告诉我如何让它工作?

我有一个角色设置为“Default”并标记为true,因此ABP在通过这种方式创建用户时似乎会自动分配这些“Default”角色。

我使用的是Zero。反正现在都解决了。我设置了一个角色,并将“Default”标记为true,因此当通过这种方式创建用户时,ABP似乎会自动分配这些“Default”角色。
Cannot insert explicit value for identity column in table 'AbpUsers' when IDENTITY_INSERT is set to OFF.