Code Monkey home page Code Monkey logo

spring_oauth2_examples's Introduction

Example Apps for oauth-spring-keycloak-integrations

Overview

Ports:

  • keycloak - 8080

  • ServiceA - 8081

  • ServiceB - 8082

overview

Start Keycloak and Configure

# start
docker-compose down --remove-orphans && docker-compose up keycloak

# configure
docker run                                              \
  -e KEYCLOAK_URL=http://host.docker.internal:8080/auth \
  -e KEYCLOAK_SSL-VERIFY=true                           \
  -e KEYCLOAK_USER=admin                                \
  -e KEYCLOAK_PASSWORD=admin123                         \
  -e IMPORT_PATH=/config/example-realm.yml              \
  -e IMPORT_FORCE=false                                 \
  -v $PWD/keycloak_config:/config                       \
  --add-host=host.docker.internal:host-gateway          \
  adorsys/keycloak-config-cli:v4.0.1-11.0.3

#
browser localhost:8080/auth/
# admin / admin123

browser http://localhost:8080/auth/realms/example/account
# test / test

Create Spring Example apps

# using spring cli
# more info: spring init --list
spring init --dependencies=web,thymeleaf,oauth2-client,devtools --package-name de.synyx.cl.oauth.examples.service.a ServiceA
cd ServiceA
# adjust application.yml
mvn spring-boot:run


spring init --dependencies=web,thymeleaf,oauth2-client,devtools,oauth2-resource-server --package-name de.synyx.cl.oauth.examples.service.b ServiceD
cd ServiceB
# adjust application.yml
mvn spring-boot:run

Client Credentials Grant Flow

curl --request POST \
  --url 'http://localhost:8080/auth/realms/example/protocol/openid-connect/token' \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data grant_type=client_credentials \
  --data client_id=service_a \
  --data client_secret=7f7367d1-f394-4a98-af5b-6c11886ff26f \
  --data audience=client_b

Dependency-Updates (renovate)

spring_oauth2_examples's People

Contributors

christlang avatar renovate-bot avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

dalakatt

spring_oauth2_examples's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

docker-compose
docker-compose.yml
maven
ServiceA/pom.xml
  • org.springframework.boot:spring-boot-starter-parent 2.6.3
  • org.springframework.security.oauth:spring-security-oauth2 2.5.1.RELEASE
ServiceB/pom.xml
  • org.springframework.boot:spring-boot-starter-parent 2.6.3
  • org.springframework.security.oauth:spring-security-oauth2 2.5.1.RELEASE
maven-wrapper
ServiceA/.mvn/wrapper/maven-wrapper.properties
  • maven 3.8.3
ServiceB/.mvn/wrapper/maven-wrapper.properties
  • maven 3.8.3

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.