我得到並嘗試了使用ADALiOS的大量樣本。正如你所知,ADALiOS不斷改變其實施。因爲我是一個快捷的初學者,所以我不知道如何從互聯網上做出樣本。ADALiOS AcquireToken()
我試了一個版本的adal 3.0(pre release)。您可以看到,下面的代碼是從下載的示例中複製的。無論其adal版本如何,每個示例都有authContext.acquireToken()或acquireTokenwithResource()方法中的編譯器錯誤,如'缺少參數標籤策略...'或'無法轉換ADAuthenticationResult ...'。任何人都可以幫助我? 錯誤消息爲completionBlock:....
感謝
authContext.acquireToken(withScopes: [Any](), additionalScopes: [Any](), clientId: clientId, redirectUri: redirectURL, identifier: id!, promptBehavior: prompt, extraQueryParameters: "", completionBlock: <#T##ADAuthenticationCallback!##ADAuthenticationCallback!##(ADAuthenticationResult?) -> Void#>){
if result.status.value != AD_SUCCEEDED.value {
// Failed, return error description
completionHandler(false, result.error.description)
}
else {
// Succeeded, return the acess token
var token = result.accessToken
// Initialize the dependency resolver with the logged on context.
// The dependency resolver is passed to the Outlook library.
self.dependencyResolver = ADALDependencyResolver(context: authContext, resourceId: self.outlookResource, clientId: self.clientId, redirectUri: self.redirectURL)
completionHandler(true, token)
}
}
我可以有一個Swift ADAL的工作樣本?互聯網上沒有ADAL快速樣本。 – Aussie