Skip to content

Exploring how to set up an Identity Server 4 from scratch

Notifications You must be signed in to change notification settings

jsoliveir/ch3-identityserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Start up the containers

docker-compose up --build --force-recreate

Discovery Endpoints & Confiurations

http://localhost:8080/identity/.well-known/openid-configuration

APIs Authorization (client credentials)

Get a new Token

$token = (curl -X POST 'http://localhost:8080/identity/connect/token' `
   --data 'client_id=service&client_secret=secret&grant_type=client_credentials&scope=weather.read' | ConvertFrom-Json
).access_token

Request the api

curl -X GET "http://localhost:8080/api/WeatherForecast" `
  -H  "Authorization: Bearer <access_token>"

OIDC (Resource Owner Password)

Get a new Token

curl -X POST 'http://localhost:8080/identity/connect/token' `
    --data 'client_id=customer&grant_type=password&username=jsoliveira&password=1234&scope=openid profile'

Get user profile info

 curl -X POST 'http://localhost:8080/identity/connect/userinfo' -H "Authorization: Bearer <acess_token>"

result:

{"username":"jsoliveira","email":"jose.oliveira@domain.com","sub":"1234"}

About

Exploring how to set up an Identity Server 4 from scratch

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published