GithubHelp home page GithubHelp logo

shammelburg / coreidentity Goto Github PK

View Code? Open in Web Editor NEW
107.0 7.0 23.0 124 KB

ASP.NET Core 3.1 - Web API, Identity, JWT, TFA, Swagger, SendGrid, EF Core SQL and Azure Storage

C# 100.00%
asp-net-core-web-api ef-core azure-storage-blob azure-storage-queue swagger asp-net-core-identity

coreidentity's Introduction

This repo will soon branch off and start moving towards ASP.NET Core 5

CoreIdentity

Using ASP.NET Core Identity Web API With JWT, TFA, Swagger, Sendgrid, EF Core and Azure Storage

This ASP.NET Core 3.1 Web API uses Identity Tables and JWT to authenticate and authorize users as well as user, role and userRole management.

This project has everything you need to get started with ASP.NET Core Web API.

  • ASP.NET Core Web API

  • ASP.NET Core Identity (SQL Server)

  • Entity Framework Core (SQL Server)

  • JWT

  • Two Factor Authentication

  • Swagger (Documentation)

  • SendGrid (Email)

  • Error Handling Middleware

  • CORS Middleware

  • Azure Storage

    • Blob
    • Queue

Getting Started

To get started locate the appsettings.Development.json and supply your connectionString.

Now add the Identity tables to your Database.

  • Tools-> NuGet Package Manager -> Package Manager Console
  • Add-migration init -Context SecurityContext
  • Update-database -Context SecurityContext

To activate emails in the API you can also enter SendGrid (free account through Azure Portal) account credentials.

Now run the API, register, confirm your email, login and receive JWT, add JWT to Authorize Header for every request after.

coreidentity's People

Contributors

shammelburg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

coreidentity's Issues

DataContext

Could you explain what datacontext is? How does it get seeded updated to database?

I ran your solution , I was able to register/ login using the SecurityContext.
But when trying to access the Example Xontroller, It always throws exceptions.

{"Could not find stored procedure 'dbo.spInsertExample'."}

Is the SP supposed to be created on itself? TIA

authorization base on the token and refresh token function

Thank you for sharing that project; it is very useful.

I have a question, after a user logs in to the app and obtains a token, is there an example of how to handle normal API requests with user authorization tokens, including options for permissions based on the user's role?

By the way, could you please add the function of refreshing the token?

Problem with generating token

I have issues accessing methods that are requiring authorization.

Problem is that even after I have added generated bearer token (AuthController -> CreateToken) - into Auth part of either PostMan or Swagger I would get 404 error.

I tried to specify Authorization to use bearer token like so:

[Authorize(AuthenticationSchemes = "Bearer")]

and specifying in AuthenticationHelper.cs

.AddAuthentication(cfg =>
                {
                    cfg.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
                    cfg.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
                })

like some of the forums online suggested, but to no avail. In best case I would get 401 Unauthorized after changing these 2 things.

Has anyone managed to make this work?

help

can u add the database? so we dont make our own one

Change SendGrid Authentication

We are emailing to inform you of an upcoming requirement to update your authentication method with Twilio SendGrid to API keys exclusively by December 10th, 2020 in order to ensure uninterrupted service and improve the security of your account. Our records show that one or more users with this email address used basic authentication with username and password for one or more of your SendGrid API requests in the last 30 days. If you do not take action, those API requests will be rejected on December 10th, 2020.

Change

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.