Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Support for Blazor WASM Running in MAUI with Desktop Deployment (Win RT) #14

Open
PaulSorauer-IPG opened this issue Aug 25, 2021 · 4 comments
Assignees

Comments

@PaulSorauer-IPG
Copy link

Hi @MikaBerglund

Great work on this library - it is easier to use, thanks.

I'm having an issue getting it to work for my use case however. As you might have guessed from the title, I'm running a MAUI App (Preview 7) which is using the Blazor project type (as opposed to XAML).

Your project looked like a Godsend, as Microsoft.Identity.Client is currently unsupported in Desktop deployments / WinUI versions of MAUI so I couldn't implement the 'standard' MSAL.NET approach.

I've tried a number of things to get Blazorade.MSAL working with no success. Firstly, I tried using o.InteractiveLoginMode = Blazorade.Msal.Configuration.InteractiveLoginMode.Redirect but for some reason the call to await MsalService.AcquireTokenAsync(fallbackToDefaultLoginHint: true) doesn't actually await but code execution continues despite the login window being displayed in the app.

I've then tried using InteractiveLoginMode.Popup and that does appear to await properly, however the app never appears to recognise the redirect URL, so it never captures the token and eventually throws a 'timed out' exception.

As per my set up for the same app deployed to Android, I tried using $"msal{settings.AppRegistrationClientId}://auth" as the redirect URL (which works fine in Android), and when that didn't work, I tried a bunch of others:

image

Any ideas on what might be going on and how to workaround it?

Cheers,

Paul.

@MikaBerglund
Copy link
Contributor

Thanks for letting me know. I'll have to dig a bit into this, because, unfortunately I have not been working with MAUI applications that much yet.

But, it seems like this might be a bug with Blazorade MSAL, or if it's not a bug, then it should be a feature in Blazorade MSAL so that you could use the library also with MAUI applications.

@MikaBerglund MikaBerglund self-assigned this Aug 26, 2021
@PaulSorauer-IPG
Copy link
Author

Thanks @MikaBerglund - will wait till you've had some time to look into it. Not a big issue for me right now.

Cheers

@PaulSorauer-IPG
Copy link
Author

Oh, and if you do want to look into supporting MAUI apps then I have a couple of idiosyncrasies with iOS / Android that I should point out so you can build in the proper support. Let me know if / when that might help.

@MikaBerglund
Copy link
Contributor

Thanks!

You can link them here under this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants