Home > other >  Authenticating a Vue 2 Azure Static Web App Locally Against Auth0
Authenticating a Vue 2 Azure Static Web App Locally Against Auth0

Time:08-24

I am researching the feasibility of porting an existing Vue 2 app to be an Azure Static Web App (SWA). A requirement is the ability to run the Vue app locally and authenticate against our Auth0 tenant to retrieve a access/bearer token to send along with our HTTP requests.

It appears that a SWA can utilize enter image description here

I also looked into the Azure Static Web App Emulator which allows for defining an identity profile when running locally, but I'm not seeing a way to specify an access token here either.

Is it possible at the moment with a SWA to obtain an access token using a custom auth provider when running locally and when published live?

CodePudding user response:

Managed Authentication in Azure is really only useful for fairly simple use cases. I think you're going to want to implement your security directly inside your Vue application.

https://auth0.com/docs/quickstart/spa/vuejs/01-login

You mentioned needing an access token but didn't say where it comes from or what you're doing with it. Are you trying to call an Auth0-secured API?

https://auth0.com/docs/quickstart/spa/vuejs/02-calling-an-api

  • Related