Azure / azure-app-service-authentication

Authentication SDKs for Azure App Service and Azure Static Web Apps
MIT License
14 stars 9 forks source link

Publish package as Microsoft.Azure.AppService.Authentication.WebAssembly 1.0.0-preview1 #6

Open anthonychu opened 3 years ago

anthonychu commented 3 years ago

Currently it's Microsoft.Azure.Functions.Authentication.WebAssembly which doesn't reflect that this package is for Static Web Apps (and in the future it could work with Easy Auth on App Service and Functions).

fabiocav commented 3 years ago

Moving this to 107 and scheduling time with @anthonychu to get this pushed out

fabiocav commented 3 years ago

@anthonychu are you blocking some time for us to follow up on this?

fabiocav commented 3 years ago

@anthonychu are we OK to close this after our last sync? The SWA team will be taking ownership of this moving forward, right?

liliankasem commented 2 years ago

@fabiocav @anthonychu any updates, can we close the issue?

oneolddev commented 2 years ago

What is the current status of this package? I'm in the process of attempting to integrate security with my Blazor application. I've been interested in doing this since @anthonychu original blog post on this subject. This looks like the package I need.

Thanks

anthonychu commented 2 years ago

This now needs to be updated to .NET 6.

+ @thomasgauvin @Reshmi-Sriram to review and prioritize.

oneolddev commented 2 years ago

@anthonychu

I thought this may be valuable to document some place but could not find an appropriate place for it. It's a bit out of place in the PWA documentation and the Static Web Apps Authentication and Authorization documentation. I'm hoping you could direct this to the appropriate people.


I ran across an issue when integrating my app. I made my changes based on the Client app in the example supplied here and Simple demo. I tested it locally with the SWA CLI locally and everything worked as expected.

I deployed the application and started testing. But when I clicked on one of the providers, the browser would refresh and the app would show Sorry, there's nothing at this address. There was no login prompt for the selected provider.

My issue was that my Client app is a PWA. The easyAuth logins are server rendered and I needed to change the service-worker-published.js file. I found the guidance for the change in the here.

Summary

Locate the following code in service-worker.published.js:

const shouldServeIndexHtml = event.request.mode === 'navigate';

Change the code to to the following:

const shouldServeIndexHtml = event.request.mode === 'navigate'
  && !event.request.url.includes('/.auth/');

asperpint commented 2 years ago

@anthonychu, any update when can we expect a released version of Microsoft.Azure.AppService.Authentication.WebAssembly.

Our use case is you use Blazor WebAssembly + Edge Deployed + Authentication + API Gateway