npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

generator-webapi-owin-jwt-aspnet-identity

v1.1.4

Published

Generates an ASP.NET Web API application with OAuth JWT implemented

Readme

build image NPM version NPM downloads Dependency Status

Generates an ASP.NET Web API that implements:

  • OAuth
  • JSON Web Tokens Authentication
  • ASP.NET Identity

This generator will provide you with a fully functional Web API application that has implemented OAuth JSON Web Token and ASP.NET Identity. This is a Yeoman generator. You will need NPM installed on your machine to generate the API. You can get npm by installing nodeJS

Once you have npm installed you will need to install Yeoman. Open a command prompt and enter the following command:

npm install -g yo

You now have Yeoman installed globally on your computer. Next you need to install this generator, again, open a command prompt and type this command:

npm install -g generator-webapi-owin-jwt-aspnet-identity

You now have the generator installed on your computer. Using the command prompt, navigate to your development working directory for this project. Once you are there, type this command:

yo webapi-owin-jwt-aspnet-identity

This will kick off the installation. During the installation, you will be asked two questions

  1. What is the name of your application
  2. What is the name of the SQL Server instance on your computer

After answering the questions, the entire API solution and project will be created. There are a few more things you will need to do before you are finished.

  1. Open the solution
  2. Right click on references in the project, and select Manage NuGet Packages
  3. In the NuGet package window you will see a yellow bar at the top. Click on the restore button on the right side of the yellow bar. This will restore all of the project dependencies.

NuGet restore

Once the restore is finished the window should look something like this:

NuGet restore finished

Now you can build the solution! Next we need to do some database work. In the Visual Studio menu to to View>Other Windows>Package Manager Console. In the console, type the following command:

add-migration "database creation"

This will create a migration file so you can now update/create your database by running this command:

update-database

Once this command is finished, you can open SQL Server Management Studio and see that the database was created.

If you have any issues during these steps it is most likely related to having the wrong database server instance name (which you entered during the installation). Check the connection string in the Web.config to make sure the instance name is correct

Now there are a few application settings that will need to be changed for enabling email notifications. In the appSettings section of the Web.config, you will need to change the following settings as needed.

<add key="emailHost" value="localhost" />
<add key="supportEmailAddress" value="[email protected]" />
<add key="supportEmailName" value="Customer Support" />
<add key="emailUser" value="[email protected]" />
<add key="emailPassword" value="yourpassword" />

If you don't have an SMTP server, you can use SMTP4Dev. While it is running it will attach to port 25 and intercept emails coming from your development projects. It has a user interface and you can open the emails.

You are ready to start testing your API. I typically use Postman. I have created a JSON Postman file that you can import into Postman to get your started. It is based on the functionality of the API you just installed.