Skip to content

IDP flow - provider flow stops when client logins in and out multiple times #3668

@ghamuirev

Description

@ghamuirev
  1. Version of Mobile SDK Used: 11.0.1 (with updated snippets from #3665)
  2. Issue found in Native App or Hybrid App: Native iOS
  3. OS Version: 17.01
  4. Device: iPhone 15 Pro
  5. Steps to reproduce:
    Setup one connected app as the IDprovider, and another as a client.
    Use IDprovider to sign the client in, followed by the client logging themselves out.
    Then use the IDprovider to sign the client in again - idp begins to start, switching to the client, then switching back to the provider as expected, but then the flow stops...

When we run the IDP for the first time it is successful - and observed that the SFOAuthCoordinator function 'decidePolicyForNavigationAction' is called multiple times.
The first time it is called it starts with the SFDCOAuthLoginHost url followed by some frontdoor and token stuff.
The second time it is called the url is 'about:blank '. After it gets to the end of the function the 'didFinishNavigation' function is called, which is supposably checking the status of the first url.
It then gets called a few more times before finishing with a final url starting with the URLscheme of the client app - and logs the client in successfully

When we run the IDP for the second time - ie. after logging the client out and trying the IDP flow again - and observe the SFOAuthCoordinator function 'decidePolicyForNavigationAction' we get this flow:
The first time it is called it starts with the SFDCOAuthLoginHost url followed by some frontdoor and token stuff just like the first time.
The second time it is called the url is 'about:blank ' again - BUT after the 'didFinishNavigation' function is never called, and the IDP flow stops.

From what we can see the two starting URL's are identical - in that the content of the URL is the same but obviously with different code challenges. So we are a bit puzzled as to why the 'didFinishNavigation' function isnt being called, and thus the second flow isn't completing.
Also - if we close the provider and try the IDP flow again, it works, so its just unable to complete the flow if we try to do the IDP flow two times in the same provider 'session' - is somthing possibly getting cached?

  1. Actual behavior:
    The provider launches the client, client continues the IDP flow before sending back to the provider, then IDP flow stops
  2. Expected Behavior:
    The provider launches the client, client continues the IDP flow before sending back to the provider, then IDprovider opens client for final time before the client is logged in successfully
  3. Error Log:
    We are not getting an error as the flow just stops, but believe the issue is related to the SFOAuthCoordinator + WKWebView flow described in step 5.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions