OAuth Flow Failing after app being added to packaged application #5071
Unanswered
homepresso
asked this question in
Q&A
Replies: 0 comments
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
-
I have a C# app that uses WebView2 to handle an OAuth login flow. Originally, when my app was unpackaged (just a regular desktop application), the user could #, and my Azure Function middleware would redirect the user back to the app with the OAuth token. Everything worked as expected.
Now, I’ve converted the app into a packaged app for the Microsoft Store (MSIX/AppX). After signing in successfully, the final redirect to my Azure Function’s callback seems to trigger a “user aborted” navigation error in WebView2, and the token never returns to my app. I’ve tried registering a custom URI scheme (Protocol) in the app manifest and handling protocol activation, but so far it hasn’t resolved the “user aborted” error.
Is there a recommended way to handle OAuth redirects with WebView2 in a packaged app?
Do I need a different approach for the callback (e.g., a custom URI scheme vs. localhost)?
How do I avoid the “user aborted” issue when the remote service redirects back to the app?
Any guidance on how to properly configure WebView2 and/or the packaged app manifest so that the token callback doesn’t fail would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions