Skip to content

feat: new endpoints(/login, /userinfo, /v2/logout) and a bundle OIDC simulation environment #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.crt
*.key
*.jwt
refresh_tokens.json
oidc*.json
oidc_credentials.conf
.DS_Store
docker/build-context/data
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.PHONY: start ps watch down stop clean

start:
docker-compose up -d

ps:
docker ps --format "table {{.ID}}\t{{.Image}}\t{{.Ports}}\t{{.Names}}"

watch:
watch 'docker ps --format "table {{.ID}}\t{{.Image}}\t{{.Ports}}\t{{.Names}}"'

down:
docker-compose down

stop:
docker-compose down

clean:
docker kill $$(docker ps -q) 2> /dev/null || true
docker system prune -a
docker volume rm $(docker volume ls -qf dangling=true)
258 changes: 67 additions & 191 deletions README.md

Large diffs are not rendered by default.

69 changes: 69 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
version: '3.4'

networks:
mynetwork:
name: mynetwork
attachable: true

services:

postgres:
container_name: idp-keycloak-db
image: postgres:12.0
# volumes:
# - type: bind
# source: ./docker/build-context/data
# target: /var/lib/postgresql/data
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: password
ports:
- 5432:5432
networks:
- mynetwork

keycloak:
container_name: idp-keycloak
image: jboss/keycloak:15.1.0
environment:
DB_VENDOR: POSTGRES
DB_ADDR: postgres
DB_DATABASE: keycloak
DB_USER: keycloak
DB_SCHEMA: public
DB_PASSWORD: password
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: password
# Uncomment the line below if you want to specify JDBC parameters. The parameter below is just an example, and it shouldn't be used in production without knowledge. It is highly recommended that you read the PostgreSQL JDBC driver documentation in order to use it.
#JDBC_PARAMS: "ssl=true"
ports:
- 8080:8080
depends_on:
- postgres
networks:
- mynetwork

nginxplus_oidc_keycloak_ubuntu18.04:
container_name: nginxplus-oidc-keycloak
build:
context: ./
dockerfile: ./docker/docker-files/nginxplus-ubuntu18.04/Dockerfile
image: nginxplus_oidc_keycloak_ubuntu18.04
ports:
- 8010:8010 # Frontend/backend example v1: landing page w/ OIDC flow w/o login button
- 8020:8020 # Frontend/backend example v2: landing page w/ login button, login button w/ OIDC flow, logout button, /userinfo, access token based API authorization
volumes:
- type: bind
source: ./
target: /etc/nginx/conf.d/
- type: bind
source: ./docker/build-context/nginx/sample/
target: /etc/nginx/sample/
- type: bind
source: ./docker/build-context/content
target: /usr/share/nginx/html/
depends_on:
- keycloak
networks:
- mynetwork
21 changes: 21 additions & 0 deletions docker/build-context/content/50x.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<title>Error</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>An error occurred.</h1>
<p>Sorry, the page you are looking for is currently unavailable.<br/>
Please try again later.</p>
<p>If you are the system administrator of this resource then you should check
the error log for details.</p>
<p><em>Faithfully yours, nginx.</em></p>
</body>
</html>
Loading