azure - Client_id 不允许给定的 URL

标签 azure oauth

我已经使用 Web API 2 实现了 Google 身份验证并收到以下错误:

The given URL is not allowed by Client_id 'ngAuthApp' configuration.

当我将 AllowedOrigin 更改为 (localhost) 但在 Azure 之后的客户端表中的 api.mytouchstones-uat.net 中不起作用时,此方法有效发布。

我的代码如下:

        // Enable the application to use bearer tokens to authenticate users
        app.UseOAuthBearerTokens(OAuthOptions);    
        //Configure Google External Login
        googleAuthOptions = new GoogleOAuth2AuthenticationOptions()
        {
            ClientId     = Common.Constant.GoogleClientId,
            ClientSecret = Common.Constant.GoogleClientSecret,
            Provider     = new GoogleAuthProvider()
        };
        app.UseGoogleAuthentication(googleAuthOptions); 

最佳答案

我遇到了同样的问题,这是我的第一个谷歌结果。所以我想如果其他人偶然发现这个问题我可能会回答。

我猜你关注了this guide ,或类似的。

检查您发送到 Facebook/Google 等的redirect_uri 是否与 dbo.Clients 中的AllowedOrigin 相同。

并确保您的 Facebook/Google 应用设置中允许使用相同的 uri。

关于azure - Client_id 不允许给定的 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27420497/

相关文章:

oauth - 在 chrome 扩展中嵌入客户端 ID

oauth - 开放式身份验证 2.0 - 固有的安全风险

php - 无法在 Linux 上安装 OAuth

Azure Active Directory 组/角色

azure - 如何强制执行 Azure Pipeline 构建任务?

sql-server - 无法修改 Azure 上的存储过程

android - 为移动应用程序创建服务器端(android)

azure - Azure 数据工厂管道中的批处理

c# - 在 Nuget 包中公开 Azure Functions

android - oAuth 1.0 获取请求改造 android