Git Product home page Git Product logo

java-oauth2-oidc-spring-rest-keycloak's Introduction

OAuth 2.0 Spring 5.x REST API with Keycloak Server

Version 0.1

Security Vulnerabilities

  1. User credentials passed with every request.
  2. User credentials would have to be stored in the Client app perhaps as plain text.
  3. Once Client has access to User credentials , Client has full control over resources i.e. impersonate the User.
  4. User credentials are stored in the application database.

Version 0.2

Security Vulnerabilities

  1. Removed version 0.1 , 1-4 vulnerabilities.

Usage for MacOS:

Step 1 : cd ./run

Step 2 : Start keycloak server. Note you have to change the default realm directory on your host first. Open the file below to make the change.

     ./start_auth_server.sh

Step 3 : Login to your auth server (username: admin , password: admin)

     http://localhost:9999/auth/

     and create user,password for user , "user_id" attribute and associated UUID and scope. 
     More info inside get_token_for.sh script.

Step 4 : In a new terminal

     ./start_resource_server.sh

Step 5 : . ./get_token_for.sh

     scope should be "product:read" or "product:write" , as defined in resource server controller.
     This can be configured by changing the controller java file.

Step 6 : echo $TOKEN to verify token is present

Step 7 : ./list_products.sh

     Should see some data returned.

Comments welcome : [email protected]

java-oauth2-oidc-spring-rest-keycloak's People

Contributors

sundarvc 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.