Git Product home page Git Product logo

effective-oauth2-with-spring-security-and-spring-boot's Introduction

To run this demo:
- Ensure your client secrets are correct, and updated in the application.yml file.
- From modules 4 - 8 an instance of a keycloak server runnning, with a user created. I have included realm-export file to setup
the demo realm if you do not wish to configure it manually by following the modules, this will set everything up for you.
- For the admin features you need a user with the portfolio_admin role, see this modules clips for instructions.
- You need to start keycloak before any of the other services as they use the issuer URI to bootstap security.
- All service pricing, portfolio and support need to be running.
- In module 7 - 8 your access token created by keycloak, needs to have the "portfolio-service" and "support-service" "aud" - audience
claim in the token, if it does not the "com.pluralsight.security.validatorsCryptoJwtTokenValidator" will deny the request. See the module demo on how to set this up.
- From module 7 the token created by the portfolio service via the client credentials grant needs to "pricing" 
scope in the user info claims, otherwise the pricing service will not start.
- Also ensure the roles mapper, and portfolio and support service audience mappers are created for the react client in keycloak.
***********************
Trouble shooting
***********************
If you have any issues try the following:
- 
- Remove your localhost browser cookie and try to re-authenticate.
- Your access token created by keycloak
- Ensure your client id and secrets are correct in the services: application.yml file.
- Enable debug logging in the application.yml file of your properties file to check the logs.
- You can use the realm-export.json file to import the keycloak demo realm with all the settings.

effective-oauth2-with-spring-security-and-spring-boot's People

Contributors

wlesniak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

effective-oauth2-with-spring-security-and-spring-boot's Issues

Customising Spring OAuth to only perform code exchange for JWT token

Hi Wojciech.

Firstly, thanks for the great course on PluralSight, your clear and concise teaching style helped me learn a lot in a short time.

I have a question which I don't think was covered in your course. If this isn't the place for questions, please let me know, I'll delete this.

I have a front end SPA that performs half of the OAuth authorisation flow, i.e. it gets the authorization code from Google's OAuth endpoint.

I want to pass this to my spring boot back end and have my back end exchange the code for a token and then establish a user session. Now I can of course do this manually and use the Google API library in Java, but there are a multitude of benefits I can derive by getting spring to do the work for me.

In your course section 'Server-side Applications: Single Sign-in with Oauth2', you show how we can add configuration to our applications, based on which Spring automatically performs the whole authorisation flow for an identity provider like Google. Is there however a well established way that I can customise spring so that it only performs the 'code for token exchange' part of the authorisation flow?

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.