Giter Club home page Giter Club logo

aws-sso-spring's Introduction

Getting this to work

This sample was created starting with Spring's own SAML2 sample application at https://github.com/spring-projects/spring-security-samples/tree/5.6.x/servlet/spring-boot/java/saml2/login-single-tenant

The template file at src/resources/templates/index.html is copied from that repository whereas other code is very similar.

The intention is to provide a minimal open source sample for how to get a working Spring Boot SAML and AWS SSO integration.

Resources

Notable

  • Single logout is supported since Spring 5.6

Instructions

  • Clone the repository and open the code in your IDE
  • Add a new Custom Application in AWS SSO
  • Copy the AWS SSO SAML metadata file URL and set it using env var METADATA_URI
  • From AWS SSO download the AWS SSO certificate and move it to src/main/resources/credentials/idp-certificate.crt
  • Go to the src/main/resources/credentials folder and generate a self-signed certificate and private key using openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 700 -nodes
  • Start your spring boot application (remember the METADATA_URI env var).
  • Download your applications metadata at {baseUri}:8080/saml2/service-provider-metadata/aws (f.e http://localhost:8080/saml2/service-provider-metadata/aws)
  • In AWS SSO, upload this metadata file. Save the configuration.
  • In AWS SSO go to Assigned users and assign your user to this custom application.
  • Next, in AWS SSO, go to Attribute mappings and map the Subject attribute to ${user:subject} with format unspecified and save.
  • Now, browse to your site (by default localhost:8080) and it should direct to AWS SSO. Log in with the user you gave access to. You should be authorized and see the sample page!

aws-sso-spring's People

Contributors

fongie avatar

Stargazers

antonio caccamo avatar

Watchers

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