Skip to content

An example of IdentityServer4 and ASP.NET Identity, Ocelot and Consul

Notifications You must be signed in to change notification settings

kimcuhoang/dnc-identity-identityserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dnc-identity-identityserver

An example of:

Getting Started

Start Consul

  • Download Consul for Windows
  • Unzip to the path, for example, C:\Consul. Then add this path to the PATH environment
  • Fire up Consul with the following command line
	consul agent -dev
  • Open browser with the link http://localhost:8500

Start Services

  • Modify the connection string in DncIds4.IdentityServer > appsettings.Development.json
  • Configure solution to run multiple project

Start Multiple Project

  • Fire up by Ctrl + F5
  • Back to browser with the link http://localhost:8500 to verify these services has been registered to Consul

Services in Consul

Identity Service

Resource Service

Use Postman

Account Registration

1. Request a token

Request Token 01

Request Token 02

Request Token 03

2. Register new account

  • Endpoint: http://localhost:5003/account/register
  • Json body
{
  "username": "kim.admin",
  "emailAddress": "[email protected]",
  "password": "Kimadmin@123",
  "isAdmin": true
}

Register Account Request

Login and retrieve weather information

1. Request a token

Request Token 01

Request Token 02

2. Get weather forecast information

  • Endpoint: http://localhost:5003/weather/forecast

Get weather forecast Request

Highlighted Points

  1. Use IHostedService to

About

An example of IdentityServer4 and ASP.NET Identity, Ocelot and Consul

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages