Skip to content

Support custom iframe attributes for silent signin - #2460

Merged
pamapa merged 1 commit into
authts:mainfrom
Sune1337:feature/iframe-attributes
Jun 15, 2026
Merged

pamapa merged 1 commit into
authts:mainfrom
Sune1337:feature/iframe-attributes

Conversation

@Sune1337

Copy link
Copy Markdown

This PR adds support for passing custom HTML attributes to the iframe used during silent signin (signinSilent).

Motivation
Recent Chrome changes around Local Network Access (PNA / Private Network Access) require explicit permission delegation for iframe-based requests to local or private network resources.

A common real-world scenario is:

A web application hosted on a private/internal address (e.g. https://app.local or an internal DNS/IP) using a public identity provider such as Microsoft Entra ID (Azure AD).

In this setup:

  • The main application runs on a private/local network
  • Authentication happens via a public endpoint (e.g. login.microsoftonline.com)
  • Silent signin is performed using a hidden iframe

With the latest browser restrictions, this iframe may be blocked unless it explicitly declares permission via:

<iframe allow="local-network-access *">

Without this attribute:

  • Silent authentication can fail
  • Users may be unexpectedly logged out or forced into full redirects

Changes
Adds optional iframeAttributes configuration:

  • Available globally via UserManager settings
  • Available per call via signinSilent arguments

Example usage
Global configuration

const userManager = new UserManager({  iframeAttributes: {    allow: "local-network-access *"  }});

Per-call override

await userManager.signinSilent({  iframeAttributes: {    allow: "local-network-access *"  }});

Notes

  • Using the feature is optional and should not change any behavior if not used.
  • Supports arbitrary attributes, allowing future browser requirements to be handled without further changes

Adds support for providing custom HTML attributes to the iframe
used during silent signin.

This enables scenarios such as Chrome Local Network Access (PNA),
where attributes like `allow="local-network-access *"` are required.
@pamapa

pamapa commented Jun 15, 2026 •

Copy link
Copy Markdown
Member

looks good, thanks for contributing

@pamapa pamapa added this to the 3.6.0 milestone Jun 15, 2026
@pamapa
pamapa merged commit 50bf374 into authts:main Jun 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants