我在 NestJS 应用程序中使用护照团队作为我的策略。昨天一切正常,但今天我收到此错误:
InternalOpenIDError: Failed to discover OP endpoint URL
这个错误最终从 node_modules\.pnpm\[email protected]\node_modules\openid\openid.js:757:14
中的这一行抛出:
return callback({ message: 'No providers found for the given identifier' }, null);
我调试了
passport-openid
中的变量,看起来authenticate
被调用了两次。第一次没有错误,我有providerUrl和正确的标识符(如果我导航到providerUrl,它就是我应该重定向到的正确URL)。但第二个错误是{ message: 'No providers found for the given identifier' }
并且providerUrl为空。
为什么我在第一次通话时没有被重定向?这是我的身份验证控制器:
@Controller('auth')
export class AuthController {
constructor(private readonly authService: AuthService) {}
@Get('steam')
@UseGuards(SteamGuard)
steamLogin() {}
}
我在我的应用程序中进行了集成,在此过程中遇到了很多问题,所以我决定创建一个存储库来分享我的解决方案。我希望它有帮助
带有护照蒸汽的 NestJS: https://github.com/Luscazi/nest-passport-steam