[英]How to implement SSO using ADFS bypassing the ADFS login page in iOS app
[英]How to implement SSO functionality on IOS using ADFS
我想使用ADFS
在IOS
single sign-on
實現single sign-on
功能。 我做了一些研發並嘗試使用MSAL iOS
庫進行ADFS
身份驗證,但它對我不起作用。
我為 ADFS 身份驗證添加了客戶端 ID、權限 URL,但它對我不起作用。 每次它給我Couldn't acquire token
錯誤。
我有不同的SSO URL
,所以不使用Microsoft azure server
。
我嘗試以下列方式為MSAL IOS
庫添加我的憑據
let kClientID = "xxxxxx-8929-4D60-B869-xxxxxxxx"
// These settings you don't need to edit unless you wish to attempt deeper scenarios with the app.
let kGraphURI = "https://graph.microsoft.com/v1.0/me/"
let kScopes: [String] = ["https://graph.microsoft.com/user.read"]
let kAuthority = "https://fs.example.com/adfs/oauth2"
任何的想法?
這里我們不需要使用 MSAL iOS。 有一個使用 Microsoft docs 的簡單解決方案。 按照鏈接:
我們只需要形成一個url字符串
這將生成一個代碼,我們可以在 App Delegate 的 openUrl 方法中獲取該代碼,然后我們需要使用參數創建一個 post 請求:
grant_type:authorization_code
code: xxxxx ( we got from get request)
redirect_uri: appName://
resource:http://xxxx/workflow
就是這樣 。 我們將獲得 access_token,我們可以進一步使用它來獲取 userProfile 等。
希望這可以幫助!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.