We're using Salesforce iOS Remote Hybrid SDK in our app, version 7.1.2, that is shared for different clients, and it works ok with simple oAuth2 flow.

However, started from Spring 2020 release, it's not so good with SSO flow, with both SAML and Open Id connect. After login, the app is getting stack in the endless refresh token request cycle.

Here is step by step details for Open Id connect flow:

  1. When user opens the app for the first time, Salesforce SDK initiate oAuth flow from https://SomeDomain.cloudforce.com page. I.e. URL like in example below opens: https://SomeDomain.cloudforce.com/services/oauth2/authorize?client_id=CLIENT_ID&redirect_uri=CONNECTED_APP_REDIRECT_URL&display=touch&device_id=DEVICE_ID&response_type=token&scope=web%20api%20refresh_token

  2. Than user is redirected to his Microsoft login page

  3. After success login, approve access to connected app and creating Pin code, user should be redirected to the start page. However, when app is trying to open start page, i.e.: https://SomeDomain.cloudforce.com/secur/frontdoor.jsp?sid=…..

SDK logic in method “isSamlLoginRedirect” started:

  • (BOOL)isSamlLoginRedirect:(NSString *)url {

    if (self.authConfig) { NSString *loginPageUrl = self.authConfig.loginPageUrl; if (loginPageUrl && [url containsString:loginPageUrl]) { return YES; } .... }

Here: loginPageURL = https://SomeDomain.cloudforce.com, url = https://SomeDomain.cloudforce.com/secur/frontdoor.jsp?sid=…..

This method defined app’s start page as URL for expired session. And then try to get new Session Id by using refresh token. After getting new Session Id, app tries to open start page URL again and get to the endless loop.

We also have tried with SDK version 8.1, but problem is the same. Do someone know any way to fix it or workaround at Salesforce or iOS site? Thanks an advance!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.