You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/active-directory/develop/reference-third-party-cookies-spas.md
+12-7Lines changed: 12 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,15 +10,15 @@ ms.service: active-directory
10
10
ms.subservice: develop
11
11
ms.workload: identity
12
12
ms.topic: conceptual
13
-
ms.date: 10/06/2021
13
+
ms.date: 03/14/2022
14
14
ms.author: ludwignick
15
15
ms.reviewer: kkrishna
16
16
ms.custom: aaddev
17
17
---
18
18
19
19
# Handle ITP in Safari and other browsers where third-party cookies are blocked
20
20
21
-
Many browsers today are blocking third-party cookies - cookies on requests to domains that aren't the same as the one showing in the browserbar. This breaks the implicit flow and requires new authentication patterns to successfully sign in users. In the Microsoft identity platform, we use the authorization flow with Proof Key for Code Exchange (PKCE) and refresh tokens to keep users signed in when third-party cookies are blocked.
21
+
Many browsers block _third-party cookies_, cookies on requests to domains other than the domain shown in the browser's address bar. This block breaks the implicit flow and requires new authentication patterns to successfully sign in users. In the Microsoft identity platform, we use the authorization flow with Proof Key for Code Exchange (PKCE) and refresh tokens to keep users signed in when third-party cookies are blocked.
22
22
23
23
## What is Intelligent Tracking Protection (ITP)?
24
24
@@ -62,12 +62,17 @@ There are two ways of accomplishing sign-in:
62
62
- When the popup finishes redirecting to the application after authentication, code in the redirect handler will store the code and tokens in local storage for the application to use. MSAL.js supports popups for authentication, as do most libraries.
63
63
- Browsers are decreasing support for popups, so they may not be the most reliable option. User interaction with the SPA before creating the popup may be needed to satisfy browser requirements.
64
64
65
-
> [!NOTE]
66
-
> Apple [describes a popup method](https://webkit.org/blog/8311/intelligent-tracking-prevention-2-0/) as a temporary compatibility fix to give the original window access to third-party cookies. While Apple may remove this transferral of permissions in the future, it will not impact the guidance here. Here, the popup is being used as a first party navigation to the login page so that a session is found and an auth code can be provided. This should continue working into the future.
65
+
Apple [describes a popup method](https://webkit.org/blog/8311/intelligent-tracking-prevention-2-0/) as a temporary compatibility fix to give the original window access to third-party cookies. While Apple may remove this transferral of permissions in the future, it will not impact the guidance here.
66
+
67
+
Here, the popup is being used as a first party navigation to the login page so that a session is found and an auth code can be provided. This should continue working into the future.
67
68
68
-
### A note on iframe apps
69
+
### Using iframes
69
70
70
-
A common pattern in web apps is to use an iframe to embed one app inside another. The top-level frame handles authenticating the user, and the application hosted in the iframe can trust that the user is signed in, fetching tokens silently using the implicit flow. Silent token acquisition no longer works when third-party cookies are blocked - the application embedded in the iframe must switch to using popups to access the user's session as it can't navigate to the login page.
71
+
A common pattern in web apps is to use an iframe to embed one app inside anotherd: the top-level frame handles authenticating the user and the application hosted in the iframe can trust that the user is signed in, fetching tokens silently using the implicit flow.
72
+
73
+
Silent token acquisition no longer works when third-party cookies are blocked - the application embedded in the iframe must switch to using popups to access the user's session as it can't navigate to the login page.
74
+
75
+
You can achieve single sign-on between iframed and parent apps with same-origin _and_ cross-origin JavaScript script API access by passing a user (account) hint from the parent app to the iframed app. For more information, see [Using MSAL.js in iframed apps](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/iframe-usage.md) in the MSAL.js repository on GitHub.
71
76
72
77
## Security implications of refresh tokens in the browser
73
78
@@ -77,7 +82,7 @@ This limited-lifetime refresh token pattern was chosen as a balance between secu
77
82
78
83
## Next steps
79
84
80
-
For more information about authorization code flow and Microsoft Authentication Library (MSAL) for JavaScript v2.0, see:
85
+
For more information about authorization code flow and MSAL.js, see:
0 commit comments