相关疑难解决方法(0)

使用Azure AD B2C身份验证为服务

我们已经使用Azure AD B2C和OAuth设置了我们的应用程序,效果很好,但是我试图将其身份验证为服务,以便对服务调用进行服务。我对此并不陌生,但是我已经学习了有关Pluralsight的一些课程,以了解如何在“常规” Azure Active Directory上执行此操作,并且可以使其正常工作,但是在B2C上遵循相同的原理是行不通的。

我有这个快速控制台应用程序:

class Program
{
    private static string clientId = ConfigurationManager.AppSettings["ida:ClientId"]; //APIClient ApplicationId
    private static string appKey = ConfigurationManager.AppSettings["ida:appKey"]; //APIClient Secret
    private static string aadInstance = ConfigurationManager.AppSettings["ida:aadInstance"]; //https://login.microsoftonline.com/{0}
    private static string tenant = ConfigurationManager.AppSettings["ida:tenant"]; //B2C Tenant 
    private static string serviceResourceId = ConfigurationManager.AppSettings["ida:serviceResourceID"]; //APP Id URI For API
    private static string authority = String.Format(CultureInfo.InvariantCulture, aadInstance, tenant);

    private static AuthenticationContext authContext = new AuthenticationContext(authority);
    private static ClientCredential clientCredential = new ClientCredential(clientId, appKey);

    static void Main(string[] args)
    { …
Run Code Online (Sandbox Code Playgroud)

azure oauth-2.0 azure-ad-b2c

5
推荐指数
1
解决办法
1297
查看次数

标签 统计

azure ×1

azure-ad-b2c ×1

oauth-2.0 ×1