获得应用程序ID使用Azure AD连接时未配置Uri错误

时间:2017-01-25 04:32:49

标签: .net authentication auth0

我使用Auth0进行身份验证。在使用凭据验证用户时,我遇到了错误,

  

未配置App ID Uri

我有2个客户端,一个客户端正在使用数据库连接,而且我能够使用该客户端验证用户。第二个客户端配置了企业连接(Active Directory / LDAP)。它无法正常工作并给我错误。

以下是我的代码,

var client = new AuthenticationApiClient(
    new Uri($"https://{ConfigurationManager.AppSettings["auth0:Domain"]}/"));

var result = await client.AuthenticateAsync(new AuthenticationRequest
{
    ClientId = ConfigurationManager.AppSettings["auth0:ClientId"],
    Scope = "openid",
    //Connection = "Auth0AuthenticationDB",
    Connection = "fredsinc-waad",
    Username = vm.EmailAddress,
    Password = vm.Password
});

// Get user info from token
var user = await client.GetTokenInfoAsync(result.IdToken);

我注意到的另一件事是,如果我使用Lock登录屏幕,那么它工作正常。

我是否需要更改auth0中的任何设置或我需要更改我的代码?

1 个答案:

答案 0 :(得分:0)

根据可用信息,您似乎已配置Microsoft Azure AD连接,并且未在连接配置中为 App ID Uri 字段指定值。

如连接设置屏幕中所述,如果您想使用/oauth/ro端点(即使用用户名和密码进行身份验证,就像看起来那样),则需要此字段。

要使用的 App ID Uri 值应在您执行的MS Azure配置中可用。以下逐步包括对该字段的引用,因此它可能有用:

https://auth0.com/docs/connections/enterprise/azure-active-directory-native

相关问题