This is the basic implementation of the OAuth 2.0 standard in ASP .Net Framework. This is my first C#
project and hopefully I met all the coding standards.
As far as I know, I didn't find any direct implementation of refresh_token
implementation online using the Visual Studio Web API Template with Individual Authentication
This is project is created using Visual Studio's WebAPI Template and then added refresh token grant on top of it. For creating a client:
POST
:api/client
withclientId
andclientSecret
You can register a user by
POST
:api/account/register
withemail
,password
andconfirmPassword
For getting an access_token
and refresh_token
:
POST
:/token
withuserName
(same asemail
),password
andgrant_type : password
.
This should provide you with a access_token
and refresh_token
After that you can use the refresh_token
to get new access_token
by:
POST
:/token
withgrant_type : refresh_token
andrefresh_token: <YOUR_REFRESH_TOKEN>
This is a very basic implementation of OAuth 2.0 Refresh Token Grants
- I cannot stress how helpful the Blog from Taiseer was during this project. He has made a similar project ~6 years back and explained everything in detail. The blog is a Five part series on how to make "Token Based Authentication using ASP .NET Web API". Check out the first part here. For the part focussing on Refresh Token check it out here
- The YouTube series by Kudvenkat is a great entry point for detailed knowledge about Web APIs. Check the Complete Playlist here. There is a text version also available on his blog.
- Lastly this StackOverFlow Question, Other Question is the only available questions on the whole StackOverFlow which is helpful. I can't believe there is no other question about it. Anyways, most of the answers and comments also link to Taiseer's blog.
A PR or any issue is always welcome to this repo. I'm a newbie in the C# world so please forgive me if my code was upto industry standards.
Please open an Issue if you have any doubts or suggestions.