Writing a OIDC implementation that sets up a (Kestrel) listener to fetch the callback from the token issuer. All works fine but now I want the app to reactivate so I have registered a custom URI scheme (iOS) and also added that scheme to the info.plist LSApplicationQueriesSchemes array.
Here's my code that gets called as a result of the OIDC callback coming back, to bring my app to the front again:
if (!await Launcher.CanOpenAsync(identifier)) // <-- returns true
return Outcome.Fail($"Cannot open application with identifier '{identifier}'");
var outcome = await Launcher.TryOpenAsync(identifier) // <-- returns true
? Outcome.Success()
: Outcome.Fail($"Cannot open application with identifier '{identifier}'");
return outcome;
NOTE: I understand that rolling one's own OIDC can be considered sketchy, with the WebAuthenticator available, but from how I understand the WebAuthenticator it only returns an access token. The flow I'm supporting also returns a refresh token and an id token.
Steps to Reproduce
Write app that performs OIDC using Browser.OpenAsync with LaunchMode = BrowserLaunchMode.SystemPreferred (I have also tested LaunchMode = BrowserLaunchMode.External) and that listens to the auth code callback
When callback comes invoke code as per above example
Ensure breakpoint is set in AppDelegate's OpenUrl method and that the method returns true
Expected Behavior
App should be brought to the front
Actual Behavior
Breakpoint in OpenUrl gets hit but nothing happens after it returns true. Browser is still at the front and the app remains in the background
Description
Writing a OIDC implementation that sets up a (Kestrel) listener to fetch the callback from the token issuer. All works fine but now I want the app to reactivate so I have registered a custom URI scheme (iOS) and also added that scheme to the info.plist
LSApplicationQueriesSchemes
array.Here's my code that gets called as a result of the OIDC callback coming back, to bring my app to the front again:
NOTE: I understand that rolling one's own OIDC can be considered sketchy, with the WebAuthenticator available, but from how I understand the WebAuthenticator it only returns an access token. The flow I'm supporting also returns a refresh token and an id token.
Steps to Reproduce
LaunchMode = BrowserLaunchMode.SystemPreferred
(I have also testedLaunchMode = BrowserLaunchMode.External
) and that listens to the auth code callbackOpenUrl
method and that the method returnstrue
Expected Behavior
App should be brought to the front
Actual Behavior
Breakpoint in
OpenUrl
gets hit but nothing happens after it returnstrue
. Browser is still at the front and the app remains in the backgroundBasic Information