Giter Site home page Giter Site logo

greticani / spring-microservice-oauth2-keycloak-starter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from liqili/spring-microservice-oauth2-keycloak-starter

0.0 1.0 0.0 84 KB

A micro service starter with Spring Boot, Spring Cloud Gateway, Eureka, Spring Security5, OAuth2, Keycloak, Docker and Docker Compose.

License: MIT License

Java 82.31% Dockerfile 17.69%

spring-microservice-oauth2-keycloak-starter's Introduction

spring-microservice-oauth2-keycloak-starter

For detailed tutorial, please refer to the post.
https://kunkkali.blogspot.com/2020/10/build-j2ee-micro-services-architecture.html

docker-compose.yml

Replace host ip inside with your own, then run the following cmd to start:

docker-compose up --build

Navigate to the following url, then Login keycloak with dev/123

localhost:8080/api/consume/

Fetch access token and refresh token from keycloak server

Post a request to get an access token:

POST http://localhost:18080/auth/realms/spring-micro-main/protocol/openid-connect/token
Content-Type: application/x-www-form-urlencoded

&client_id=spring-micro-gateway&username=dev&password=123&grant_type=password&client_secret=756b0558-018b-4809-b478-bd5b4995d325

Test API

Get request with bearer token:

GET localhost:8080/api/produce/
Authorization: Bearer <your bearer token here>

spring-microservice-oauth2-keycloak-starter's People

Contributors

kunkka2021 avatar liqili avatar

Watchers

James Cloos avatar

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.