Skip to content

How to keep login status in iOS WKWebview #7439

Open
@odhk-fe

Description

@odhk-fe

Core Library

MSAL.js (@azure/msal-browser)

Wrapper Library

MSAL React (@azure/msal-react)

Public or Confidential Client?

Public

Description

Thank you for taking the time to look into this issue.

I greatly appreciate the convenience Azure AD B2C provides, but I’ve encountered difficulties with integrating it across iOS and web platforms.

After logging in using the MSAL for iOS SDK, when I open a webpage requiring login via WKWebView, the webpage prompts me to log in again.

Both the redirect_url for my iOS app and the redirect_url for the SPA are registered under the same application. I assumed they should share the session.

I came across this documentation: Customize Webviews with MSAL for iOS. I’ve also tried using ASWebAuthenticationSession and SFAuthenticationSession, but neither approach retained the logged-in state.

Here are my questions:

  1. Does msal.js provide any methods to allow WKWebView in the iOS app to maintain the logged-in state?
  2. Is there any API that enables me to pass the accessToken and idToken obtained during iOS login, so I can automatically log in on the web?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Attention 👋Awaiting response from the MSAL.js teamfeature-unconfirmedmsal-browserRelated to msal-browser packagemsal-reactRelated to @azure/msal-reactpublic-clientIssues regarding PublicClientApplicationsquestionCustomer is asking for a clarification, use case or information.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions