Giter VIP home page Giter VIP logo

solid-auth's Introduction

Solid auth with Spring Boot and Spring Security

Solid Authentication combined with Spring Boot. This project demonstrates the Solid Authentication process (OAuth2 - OIDC as specified in the Solid OIDC Primer) combined with Spring Boot and Spring Security).

You can find extra explanation for this repository in the document we posted on the Konsolidate website.

Remark: this code is not tested for production and may be outdated at any point in time.

โšก Requirements

๐Ÿ’ป Running the application locally

There are several ways to run a Spring Boot application on your local machine. One way is to execute the main method in the eu.konsolidate.auth.AuthApplication class from your IDE.

Alternatively you can use the Spring Boot Maven plugin like so:

mvn spring-boot:run

๐Ÿ“ƒ Client registration

You need to register your application at the identity provider of your choosing. You can do that by sending a POST request to the correct url from your identity provider. You can check the OpenId Configuration from your identity povider at (there you will find a JSON string with "registration_endpoint"):

https://YOUR_IDENTITY_PROVIDER/.well-known/openid-configuration

Keep in mind that you should execute this request with a body.

Request body

Parameter Value
redirect_uris ["YOUR_REDIRECT_URIS", "...", "..."]
application_type "web"
token_endpoint_auth_method "authorization_code"
scopes "openid,webid,offline_access"

Explaining the redirect uris

  • see application.yml for "{baseUrl}/login/oauth2/code/{registrationId}",
  • it contains the baseUrl from your application (when running locally: http://localhost:8080),
  • and also the registrationId (which can be: "community-solid-server", "inrupt" or "solidcommunity")

Response

Your identity provider should respond with "client_id" and "client_secret" (and also some other fields which we don't use in this application).

๐Ÿ—ƒ Environment variables

The application uses environment variables for securing id's and secrets. The mandatory environment variables are listed below:

In application.yml

  • CSS_CLIENT_ID
  • CSS_CLIENT_SECRET
  • SOLIDCOMMUNITY_CLIENT_ID
  • SOLIDCOMMUNITY_CLIENT_SECRET
  • INRUPT_CLIENT_ID
  • INRUPT_CLIENT_SECRET
  • REDIRECT_URL

In CustomAuthenticationSuccessHandler

  • REDIRECT_URL

๐Ÿ“œ License

The Solid Auth code is copyrighted by Konsolidate and available under the MIT License.

solid-auth's People

Contributors

warddriesenkonsolidate avatar copchristophe avatar

Stargazers

 avatar  avatar Mithun Khatri avatar Yavuz Peksen avatar Johan Silkens avatar Jasper avatar Benjamin Bellamy avatar Dylan Van Assche 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.