Activities of "ldacnfinit"

你好。我已经完成了第三方认证部分,获得了所需的用户信息,并且在数据库中查到了该用户,现在需要做的是登录并且返回到客户端站点,但我遇到了一个如上所示的异常信息,如果我将 ConfigureAuthentication 中的 RequireAuthenticatedSignIn 设置为 false 后,该问题即不存在,会跳转到客户端,但是并没有登录成功。希望能得到您的帮助。谢谢!

很抱歉,因为第三方的认证需要内网才可以进行,这意味着您无法进行认证的调试,所以您是否还需要项目?

Hi, 我已经卡在这个问题上一天了,经过修改已经可以实现不设置 RequireAuthenticatedSignIn = false 使用 HttpContext.SingIn 不会报错,代码改动如下:

  var isUser = new IdentityServerUser(user.Id.ToString());
                var principal = isUser.CreatePrincipal();
                principal.AddIdentity(
                new ClaimsIdentity(
                                new List<Claim>
                                {
                                    new Claim(AbpClaimTypes.UserId,user.Id.ToString()),
                                    new Claim(AbpClaimTypes.UserName,user.UserName),
                                    new Claim(AbpClaimTypes.Email,user.Email)
                                }
                            )
                    );
                await HttpContext.SignInAsync(IdentityServerConstants.ExternalCookieAuthenticationScheme, principal);

但在跳转回 Angular 时,https://localhost:44361/api/abp/application-configuration 接口返回的仍然是没有登录,返回结果如下图所示:

所以我的问题的关键在于如何使当前用户登录上去,这块我理解的不到位,是否是根据 cookie 或者 access token 来实现校验的?api/abp/application-configuration 接口的源代码链接方便发我一下么。 另外想问下是否提供远程协助。

PS:不使用 Abp 框架中的 angular 部分, 采用 asp.net 来测试是否可以跑通,我认为意义不是很大。

随时期待您的回复。

好的。我将会试试使用 GitHub认证,跑下整个流程。

已经在开发环境解决了认证授权问题,但是在部署到生产环境时,在请求第三方认证站点时出现了CORS 问题,部署环境为 IIS,请问如何解决这个问题。 尝试过以下两种方案: 第一种,使用 Angular Proxy config,但是没生效 第二种,将 oAuthConfigissuer设置为源站,在 IIS 中将请求转发到认证站点,但出现了新问题 main-es2015.22bb79fb162f00377e5b.js:1 invalid issuer in discovery document expected: https://源站.com.cn current: https://认证.xxx.com,所以还是需要使用第一种,直接解决跨域的问题

hi

Please share full error info.

Because the number of log words exceeded the maximum allowed for a post, I posted a blog with a link to https://www.cnblogs.com/zinan/p/16007487.html

Hi @ldacnfinit, can you try to create a UOW in your ImportByExcelFile method manually, like below:

 
private readonly IUnitOfWorkManager _unitOfWorkManager; 
 
public virtual async Task> ImportByExcelFile(IFormFile file)  
{ 
     using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true)) 
     { 
      //... 
       
      await _identityUserManager.CreateAsync(ObjectMapper.Map(s), userPwd, false); 
       
      await uow.CompleteAsync(); 
     } 
} 

https://docs.abp.io/en/abp/latest/Unit-Of-Work#begin-a-new-unit-of-work

Ok, Thanks a lot! It works!

I think I know the use of callback option in integration OIDC authentication, It's solved, thanks a lot.

hi

Please check the logs of the backend.

Are you set the Redis?

Hi, We don't use Redis, In development the backend logs don't has exception.

Please share the logs when the request is slowly.

Sorry, I can't provide the log now, when I run into the question, I'll reopen and paste the log.

Showing 1 to 10 of 24 entries
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on July 08, 2025, 08:19