Title: Azure AD signout redirect url error “X-Frame-Options“ directive set to “DENY“
Tags: azure;azure-active-directory;azure-ad-b2c
Question: The loading of “https://login.microsoftonline.com//oauth2/v2.0/authorize?response_type=code&amp;client_id=&amp;scope=openid%20profile%20offline_access%20https://graph.microsoft.com/User.Read%20api://88730ebd-6d43-490e-bf63-56f62c567580/access_as_user&amp;state=QKtRP3dhjo3cwQR_mfQ35UPbNfDtr1lrrqepRy0VpgI%3D&amp;redirect_uri=https://ipv5-dev.insights.pwc.com/ip-core-azure-ad-service/login/oauth2/code/&amp;nonce=xwXhlKO89Drh4m3P6qgSNWvroFAscaLR-AImtF-RKSc”
in a frame is denied by “X-Frame-Options“ directive set to “DENY“. authorize
Comment: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.


Here is another answer: This error occurs due to when the AccessToken lifetime is set to 60 minutes, once accesstoken expires, when we are trying to request an authorized API endpoint, we could see X-Frames-Options to deny.
And also If your application cannot be loaded in an iframe, MSAL will be unable to silently acquire tokens.
A possible solution is to create a dedicated page to use as your redirect uri for silent operation like
To set the  X-frame-options of value is SAMEORIGIN
<customHeaders&gt;
<add name=&quot;X-Frame-Options&quot; value=&quot;SAMEORIGIN&quot; /&gt;
</customHeaders&gt;
Reference:
Refused to display  https://login.microsoftonline.com/common/oauth2/ in a frame because it set 'X-Frame-Options' to 'deny'. · Issue #494 · AzureAD/microsoft-authentication-library-for-js (github.com)

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 1, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2022:00:08/04/22', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<azure><azure-active-directory><azure-ad-b2c>', 'Title': 'Azure AD signout redirect url error “X-Frame-Options“ directive set to “DENY“', 'ViewCount': 78, 'id': 73236530, 'user_AboutMe': None, 'user_AccountId': 25976900.0, 'user_DisplayName': 'debasish pradhan', 'user_Reputation': 1.0, 'user_Views': 2.0, 'user_id': 19691231.0}}