We created a simple iOS native app, which should allow users to login into SF once and then open Lightning community app in a Webview. For this purposes we have below steps:
- User launch the mobile app;
- App calls Mobile SDK, which redirects to community login page, where user enters login and password; That allows us to get and refresh session token if this is required.
- We get an authorization token and passing community URL + token into WebView.
We tried to pass authorization using frontoor.jsp or passing token as a parameter like:
let request = try! URLRequest(url: URL(string: "<Link to community page>")!, method: .get, headers: ["Authorization" : "Bearer \(token!)"])`
Both ways works fine when I try to open classic SF page or application. But when I try to open Community page it asks login again. So that means that those ways does not work with a community pages.
How can I pass authorization token to a Webview for a community users?