Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication in ASP.NET Core API without using third party solutions #32293

Closed
v8ify opened this issue Apr 30, 2021 · 1 comment
Closed

Authentication in ASP.NET Core API without using third party solutions #32293

v8ify opened this issue Apr 30, 2021 · 1 comment
Labels
area-identity Includes: Identity and providers ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved

Comments

@v8ify
Copy link

v8ify commented Apr 30, 2021

I am building a monolithic API using ASP.NET Core and I want authentication to use JWT.
The official docs suggest following three options for authenticating users accessing web API:

  • Azure Active Directory
  • Azure Active Directory B2C
  • IdentityServer4

But I don't want to use third party providers. And I sure as hell don't want to use IdentityServer4 ($1500/year)

Basically I want the authentication to behave the same way it does with Razor Pages app where Identity takes care of hashing, salting passwords, registration and saves it to the local database. Except in this case I want to use JWT Tokens instead of Cookies for authentication and authorization.

Why isn't there such and option on official docs / VS 2019 template.

How can I achieve this?

I am doing something similar to this guy but I wish there was much easier, "official" way of doing this so that I don't introduce security bugs while writing custom implementation.

Frankly, it is amazing to me that I can do this in Razor Pages and not in Web API.

@javiercn javiercn added the area-identity Includes: Identity and providers label Apr 30, 2021
@javiercn
Copy link
Member

@Prajwal-Jadhav thanks for contacting us.

This is a dupe of #27053, please upvote that issue instead.

@javiercn javiercn added the ✔️ Resolution: Duplicate Resolved as a duplicate of another issue label Apr 30, 2021
@ghost ghost added the Status: Resolved label Apr 30, 2021
@ghost ghost locked as resolved and limited conversation to collaborators May 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-identity Includes: Identity and providers ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved
Projects
None yet
Development

No branches or pull requests

2 participants