SoftwareAteliers/asp-net-core-vue-starter

Auth0

julian-code opened this issue · 2 comments

Hey liborpansky.

Thanks for this awesome template.

I really want to explore Vue and ASP.net core with Auth0. However, I have struggle to make Auth0 work properly with this template.

Do you know, how to set it up? Do I need to configure it in my Vue app or at ASP.net core level?

Have a nice day :-)

Hi, personally I've never used Auth0 - I prefer to use Identity Server 4, which offers you the same features (JWT / OAuth 2.0/ OpenID Connect), but it's hosted by you without paying for authentication as a service...

Anyway, logic is the same for both IS4 and Auth0 - you have to authenticate your users from vue app redirecting them to SSO server and get back an access token and save it client side. Then you use the token (send in HTTP Authentication Header) to communicate with API.

So the implementation you have to do has two parts:

  • Client implementation - use oidc client or auth0-js to resolve authority server and redirect user to SSO server and save access token on redirect back
  • Server implementation - apply JWT or OWIN authentication middleware to ASP.NET Core API to validate incoming token

I suggest you to check Identity Server Documentation or Auth0 documentation, it's really detailed and explains everything...

Vue app Identity Server
Vue app Auth0
ASP.NET Core API Identity Server
ASP.NET Core API Auth0

Good luck!

Hey @liborpansky.

Very nice answer and quick reply. Really appreciate it.