Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/altair-bueno/poc-jwt
Proof of concept: JWT based microservices
https://github.com/altair-bueno/poc-jwt
axum deno docker fastapi jwt spring-boot svelte
Last synced: 8 days ago
JSON representation
Proof of concept: JWT based microservices
- Host: GitHub
- URL: https://github.com/altair-bueno/poc-jwt
- Owner: Altair-Bueno
- License: mit
- Created: 2022-07-15T17:55:26.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-08-01T14:01:32.000Z (over 2 years ago)
- Last Synced: 2024-10-12T07:49:42.378Z (2 months ago)
- Topics: axum, deno, docker, fastapi, jwt, spring-boot, svelte
- Language: TypeScript
- Homepage:
- Size: 331 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Proof of Concept: Json Web Tokens
This repository contains a POC of how to use JWT with a SSO service to
authenticate a user across multiple services.## Contents
- [authserv](authserv/)(Spring-Boot): SSO service based on basic authentication.
Generates JWT tokens that other services consume
- [axum-transform](axum-transform/)(Rust): Offers text transformation utilities
to authenticated users
- [spring-ping](spring-ping)(Spring-Boot): Simple ping server that only responds
to authenticated users
- [tsdeno](tsdeno/)(Deno + Oak): Sample Oak application that manages Dinos!
- [slowapi](slowapi/)(Fast API): TODO crud
- [svelte-front](svelte-front/)(Svelte + TS): SPA that consumes most services## Configuration details
### Generating a RSA key pair
Asymmetric cryptography is required to sign and verify JWT. Only the
authentication server (`Authserv`) requires access to the private key. Check
each project for more information about how you should provide the public key```shell
# https://stackoverflow.com/a/44474607/19176002
openssl genrsa -out keypair.pem 2048
openssl rsa -in keypair.pem -pubout -out public.key
openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in keypair.pem -out private.key
```## Example deployment: Docker compose
A sample Docker compose is provided. `svelte-front` will be available at
```shell
# To start the service
docker compose up -d
# To stop the service
docker compose down
```> Note: Docker compose requires building the docker containers from source