ios - ios 中的 Windows azure 事件目录身份验证

标签 ios windows windows-authentication azure-queues

任何在 windows azure 和 iOS 上工作过的人,以及如何访问 windows azure 事件目录...... 请帮助我下面的主题我将在编码中设置下面提到的主题的值是什么......

WAAD_LOGIN_URL WAAD_DOMAIN WAAD_CLIENT_ID WAAD_REDIRECT_URI WAAD_RESOURCE WAAD_SERVICE_ENDPOINT

请提前向我提供帮助:)

最佳答案

您可能需要检查开源 github 库以进行身份​​验证:https://github.com/MSOpenTech/azure-activedirectory-library-for-ios .我目前是主要贡献者,所以请随时向我询问有关图书馆的更多问题。自述文件将让您了解如何验证和开始使用提供的访问 token 。 这是获取访问 token 的示例代码。请记住,访问 token 是在内部缓存的,因此您只需在每次需要时调用下面的 acquireTokenWithResource,该库负责身份验证(如果需要,请向用户询问凭据)并通过 OAuth 2.0 协议(protocol)利用刷新 token .

ADAuthenticationError *error;
authContext = [ADAuthenticationContext authenticationContextWithAuthority:authority
                                                                    error:&error];

NSURL *redirectUri = [NSURL URLWithString:redirectUriString];
[authContext acquireTokenWithResource:resourceId
                             clientId:clientId
                          redirectUri:redirectUri
                      completionBlock:^(ADAuthenticationResult *result) {
    if (AD_SUCCEEDED != result.status){
        // display error on the screen
        [self showError:result.error.errorDetails];
    }
    else{
        //Use result.accessToken to access any services.
    }
}];

关于ios - ios 中的 Windows azure 事件目录身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22371401/

相关文章:

windows - 通缉 : WinAPI calls logger

c# - 如何以编程方式跟踪 .lnk 文件

iis - CORS 预检请求使用 Windows 身份验证返回 HTTP 401

c# - Windows 身份验证不适用于本地 IIS 7.5。错误 401.1

ios - 无法在 UIScrollView 中的 UITableView 上同时向上/向下滚动和向左/向右滚动

ios - 无法访问 Pod 中存在的 ViewController

ios - 有没有办法在 AVPlayerLayer 中捕获 View 的屏幕截图?

Windows 上的 Python - 如何等待多个子进程?

asp.net - 即使启用了Windows身份验证,HttpContext.Current.User也为null

ios - 具有单一数据库和单一登录的多个 iOS 应用程序