Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iljavaleev/simple_oauth2
Educational oauth2 implementation
https://github.com/iljavaleev/simple_oauth2
cmake cpp20 cpr crowcpp docker inja jwt-cpp jwt-token mongocxx mongodb nlohmann-json
Last synced: about 1 month ago
JSON representation
Educational oauth2 implementation
- Host: GitHub
- URL: https://github.com/iljavaleev/simple_oauth2
- Owner: iljavaleev
- License: mit
- Created: 2024-09-10T13:37:02.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-10-24T13:44:02.000Z (2 months ago)
- Last Synced: 2024-10-25T16:29:39.740Z (2 months ago)
- Topics: cmake, cpp20, cpr, crowcpp, docker, inja, jwt-cpp, jwt-token, mongocxx, mongodb, nlohmann-json
- Language: C++
- Homepage:
- Size: 7.83 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# simple_oauth2
## Simple implementation of OAuth2 protocol inspired by book OAuth 2 in Action (Justin Richer (Author), Antonio Sanso).
The code was completely rewritten in C++, using MongoDB as the NoSQL database. HTML templates remained almost unchanged.### Description
There are three parts that interact with each other: the client (abstract application), the authentication server and protected resource.
The client redirects the user to the authentication server to gain access to the resource
The user decides whether to grant access permission to client and to what extent(scope).
Next comes gaining access(receiving a token) and the ability to request data from the resource.All three parts in different docker containers.
## Run application
### Run with Cmake
For example for client:
```
cd client
mkdir build && cd build
cmake ..
make
./client
```
You need to export envs from .cmake.env
### Run with docker compose
In infra path execute
```
docker compose --env-file .env -f docker-compose.yml up -d
```
There is image in docker hub for each part. If you want to build localy you can use generic Dockerfile in the infra path.Next you need to go to the http://localhost:9000 endpoint in the browser.