- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我已经为 ADAL 身份验证设置了一个演示应用程序。我公司要求安装InTune应用程序:https://itunes.apple.com/us/app/intune-company-portal/id719171358?mt=8
安装并设置 InTune 后,我使用我开发的 ADAL 安装了演示:
添加 ADAL 作为 Pod 库
在我的 Azure 门户 ( https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps ) 中添加了重定向 URI(一个带有 schema://bundle_id,另一个带有 msauth://code/schema%3A%2F%2Fbundle_id)
添加到应用程序的 info.plist:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>msauth</string>
</array>
4.添加到应用程序的info.plist
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>bundle_id</string>
<key>CFBundleURLSchemes</key>
<array>
<string>schema</string>
</array>
</dict>
</array>
添加了 [_authContext setCredentialsType:AD_CREDENTIALS_AUTO];
以使用 inTune App Portal 进行代理身份验证。
创建身份验证:
ADAuthenticationError *error = nil;
_authContext = [ADAuthenticationContext authenticationContextWithAuthority:@"https://login.microsoftonline.com/common" error:&error];
[_authContext setCredentialsType:AD_CREDENTIALS_AUTO];
[_authContext acquireTokenWithResource:@"https://graph.microsoft.com"
clientId:@"my_client_id" // Comes from App Portal
redirectUri:[NSURL URLWithString:@"schema://bundle_id"] // Comes from App Portal
completionBlock:^(ADAuthenticationResult *result)
{
NSLog(result.accessToken);
}];
应用程序将正确提示用户进行 microsoft 身份验证,即在公司页面上的 microsofth 身份验证上重定向,但身份验证后,结果如下:
最佳答案
要让 Azure AD 确定设备已受管理以满足条件访问要求,您必须使用代理身份验证。这是通过指定 AD_CREDENTIALS_AUTO
(您已完成)、将 msauth
添加到 LSApplicationQueriesSchemes
(您已完成)并配置适当的回调 URI 来启用的您的应用程序的方案(您也已完成)。
将使用的代理是 Microsoft Authenticator应用程序。如果您没有安装此程序(ADALios 框架通过检查是否有响应 msauth
url 方案的应用来确定),则 ADAL 库将默认显示登录表单应用程序中的 WebView 。
由于您的应用无法确定设备是否受管理,因此您会收到“身份验证成功,但您的设备未注册”结果。
安装 Microsoft Authenticator 应用程序后,您将看到它已打开以响应身份验证请求。此应用程序可以确定您设备的注册状态,然后您应该会返回到您的应用程序并获得成功的 token 。
安装验证器应用程序的要求可以在库文档中更明确地指出,但提到了:
If your app requires conditional access or certificate authentication (currently in preview) support, you must set up your AuthenticationContext and redirectURI to be able to talk to the Azure Authenticator app.
关于ios - ADAL 身份验证需要设备管理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52273913/
如何配置 ADAL JS 以使用本地 Active Directory(Windows Server 2012 R2、ADFS)? GitHub 上的公告帖子 ( http://www.cloudid
我正在使用 Javascript(不带 Angular)向我的单页 Web 应用程序添加 AAD 身份验证。初始登录工作正常,但一个小时后, token 过期,我无法使用acquireToken 更新
我正在使用 Microsoft.Experimental.IdentityModel.Clients.ActiveDirectory 用于对 Outlook.com API 进行身份验证的 Nuget
我正在使用在 azure ad 中进行身份验证的应用程序。我使用 adal.js 来获取访问 token 。但是访问 token 的有效期只有 1 小时。那么如何使用我在 Adal js 中的刷新 t
我有一个使用 Web 表单编写的旧应用程序。在这个项目中,我们开始将一些 Webform 转换为 SPA、Angular.js 和 WebAPI。 SPA 页面直接与 WebAPI 通信。我们的想法是
我已经使用 SPA 应用程序设置了 adal 和 adal-Angular v.1.0.10 库,并取得了巨大的成功。我正在使用 webpack,但在我的 html 页面中引用这些,希望避免全局范围问
我已经使用 SPA 应用程序设置了 adal 和 adal-Angular v.1.0.10 库,并取得了巨大的成功。我正在使用 webpack,但在我的 html 页面中引用这些,希望避免全局范围问
我正在我们的应用程序中实现 AAD 单点登录,我们将在我们的 MEAN 堆栈应用程序中使用 adal.js/adal-angular.js 库。初始化库的一部分是调用 init() 并提供租户和 cl
我在 Azure AD 中注册了一个控制台应用程序,该应用程序连接到 CRM Online(使用 these steps 配置)。它查询 Web API。 应用程序需要在没有用户交互的情况下运行...
我正在创建一个使用 Azure Active Directory 身份验证库作为身份验证提供程序的网站。我按照本教程在我的开发环境中建立了工作环境。 https://github.com/AzureA
我使用 ADAL for android 编写了下面的身份验证代码: mAuthContext = new AuthenticationContext(MainActivity.this, Const
我在 iOS 应用程序中使用 ADAL v2.5.4 自动登录时遇到问题。 当用户想要登录 MSA 帐户时,我们会使用所需的参数调用 acquireTokenWithResource,并将提示行为设置
var outlookServicesClient = await AuthenticationHelper.EnsureOutlookServicesClientCreatedAsync("Cale
我已经为 ADAL 身份验证设置了一个演示应用程序。我公司要求安装InTune应用程序:https://itunes.apple.com/us/app/intune-company-portal/id
我正在尝试开发一个VueJS单页应用程序,该应用程序会将您登录到AAD,以便我可以获取访问 token 以调用各种API(例如Graph)。 用户登录后,您必须获取 token ,并且有两种方法可
我正在使用以下代码对我的 Azure 试用帐户中的默认用户进行身份验证。 static void Main(string[] args) { GetTokenAsync
我刚开始使用 adal-node npm 包。 在示例中提到: var resource = '00000002-0000-0000-c000-000000000000'; 这个 ID 是从哪里来的?
AzureAD 支持 OAuth 资源所有者密码凭据授予。 ADAL SDK 最近添加了对其的支持 ( https://www.nuget.org/packages/Microsoft.Identit
我正在尝试从我的 Auth0 设置中获取访问 token ,我正在使用 ADAL。当我查看 fiddler 时,我不明白为什么它试图连接到以下站点: https://login.windows.net
我正在尝试将 adal.js 集成到我的应用程序中。下面是我的代码。有人可以告诉我为什么未触发身份验证吗? var app = angular.module('TestWebApp', [ 'n
我是一名优秀的程序员,十分优秀!