[Bug] [Question] Unable to use MSAL browser auth (Graph API) in Code Apps — dynamic iframe URL prevents redirect URI registration #273
LeHailender
started this conversation in
General
Replies: 1 comment
-
|
@LeHailender - This is not something we support. The recommended approach is to use a custom connector. Custom connectors are supported today in code apps. Please give that a try and let us know if you have any questions |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
Power Apps Code Apps run inside a sandboxed iframe with a dynamic URL that changes on every deployment:
https://.environment.api.powerplatformusercontent.com/.../storageproxy//index.html
The storageproxy segment includes a timestamp (e.g., 20260318t164616z4f80d73c36) that changes with each pac code push. This makes it impossible to register a stable redirect URI in Azure AD App Registration for browser-based MSAL authentication flows.
Why this is a problem
Any Code App that needs to call Microsoft Graph API (e.g., SharePoint files, user photos, Teams presence) with delegated permissions requires browser-based MSAL authentication. Since no MSAL flow (redirect, popup, or custom window) can work with the dynamic iframe URL, Code Apps cannot authenticate to Graph API when running in Power Platform.
The same app works perfectly in local development (http://localhost:5173) because the URL is stable and can be registered.
What we tried
Expected behavior
Code Apps should provide one of the following:
Environment
Minimal reproduction
Beta Was this translation helpful? Give feedback.
All reactions