This repository is an educational project and shows how to implement:
- An Oauth 2.0 Server using hydra and an Identity Provider
- An Oauth 2.0 Client, which requires permissions to access resources of a resource owner and a Resource Server
- An Open ID Connect Client and REST server which requires LogIn via OIDC and implements a ORM database and an authorization server by the Casbin framework
This guide is for Linux users.
- Install docker
- Install Ergo Proxy
$ curl -s https://raw.githubusercontent.com/cristianoliveira/ergo/master/install.sh | sh
- Clone this repository and download dependencies
go mod download
Before starting the examples, set up automatic proxy configuration with: http://localhost:2000/proxy.pac
To simplify, there are two scripts:
./upOA.sh
for the example of Oauth 2.0. To access the client app http://oaclient.test./upOIDC.sh
for the Open ID Connect example. To access the client app http://oidcclient.test
If you are running Hydra for the first time, you need to add the clients
addClientOA.sh
addClientOIDC.sh
Test Credentials:
For example 1:
For example 2:
- Students:
- Teachers:
The password for all accounts is "password"
To remove all running processes you can run ./down
To update HTML code ./bind