aspnetcore-Vue-starter icon indicating copy to clipboard operation
aspnetcore-Vue-starter copied to clipboard

Proposal: JwtBearerAuthentication

Open elucidsoft opened this issue 7 years ago • 9 comments

I added this to my application using your template as a starter, it was very easy following the guidance at: https://fullstackmark.com/post/10/user-authentication-with-angular-and-asp-net-core

I think the template should include this, as everyone is going to need to some sort of client/server authentication in their app. Well nearly everyone...

elucidsoft avatar Aug 25 '17 00:08 elucidsoft

Definitely it's on the agenda to have JWT default in both this and the angular repo. Glad you got it working! If it's easy enough to get a PR in for it it would be great for others using the template too! If you have the time. 🙏👍

MarkPieszak avatar Aug 25 '17 02:08 MarkPieszak

this kind of seems like it needs something like a generator program like vue-cli, where you can opt in for things like authentication, unit testing, nightwatch, lint rules, css framework (like bulma / bs4 ) etc.

keithn avatar Aug 29 '17 10:08 keithn

We should perform this work on another branch, I have already started the work on this on a clone but it's going to be a rather large effort.

elucidsoft avatar Aug 30 '17 17:08 elucidsoft

Is this something you have actively started work on? I am really looking for a quick spin up Vue solution template that includes authentication - not a one in sight except a built from the literal bottom up Vscode solution I found here: https://github.com/mrellipse/toucan

RIDusten avatar Nov 13 '17 22:11 RIDusten

I was but got side tracked on other open source projects. I also found out that Microsoft is working on adding a JwtBearer provider OOB to ASP.NET Core in the near future you should see that coming. In the meantime I have a working solution using Auth0 that I am using. The Auth0 implementation is quite easy and will take you only seconds. My plan is to use Auth0 until Microsoft ships the JwtBearer support OOB that way I am using something native.

elucidsoft avatar Nov 14 '17 00:11 elucidsoft

I used IdentityServer 4 and it took only a few minute to setup the authentication/etc. (Adding the package, setting up the configuration and then add the [authorize] tag where needed).

After I think that adding the full identity scaffolding within this template is maybe not necessary. Maybe if there were a few templates I wouldn't say no. Example of 3 templates: Light, With identity provider, With identity server.

Nordes avatar Feb 21 '18 13:02 Nordes

I have made a full example using OpenId. I guess with the JWT it would be pretty much the same code.

I use IdentityServer4 + Ldap authentication (custom module I made) + MvcVueClient using this demo + ui. I've added some security within it. Maybe it's not perfect but it works pretty well.

Github solution: https://github.com/Nordes/IdentityServer4.LdapExtension Project name within the solution: MvcVueClient

Info: If you type localhost:5006/profile it will redirect you to the OpenId service to login. However if you hit an API (/api) it will send you a 401 not authorized instead of trying to redirect you.

Nordes avatar Mar 10 '18 13:03 Nordes

I would love to see this template with Authorization and Authentication. This template hits all the check marks besides Authorization and Authentication

ty-fleming avatar Jun 17 '18 03:06 ty-fleming

How about using OpenIDDict? I used it in a few projects already and it works flawlessly. I think it would be a great addition to kick start any project using this template.

xShivan avatar Oct 02 '18 06:10 xShivan