Skip to content

danilopiazza/spring-boot-saml-login

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation

On Windows, either install OpenSSL or use WSL.

Relying Party SSL Certificate

  1. Create a directory named certs under src/main/resources

  2. Generate an SSL certificate

    • Run:

      openssl req -x509 -newkey rsa:4096 -keyout src/main/resources/certs/rp-private.key -out src/main/resources/certs/rp-certificate.pem -nodes
      
    • Output:

      Generating a RSA private key
      ...............++++
      ..........................................................................................++++
      writing new private key to 'src/main/resources/certs/rp-private.key'
      -----
      You are about to be asked to enter information that will be incorporated
      into your certificate request.
      What you are about to enter is what is called a Distinguished Name or a DN.
      There are quite a few fields but you can leave some blank
      For some fields there will be a default value,
      If you enter '.', the field will be left blank.
      -----
      Country Name (2 letter code) [AU]:
      State or Province Name (full name) [Some-State]:
      Locality Name (eg, city) []:
      Organization Name (eg, company) [Internet Widgits Pty Ltd]:
      Organizational Unit Name (eg, section) []:
      Common Name (e.g. server FQDN or YOUR name) []:
      Email Address []:
      

Identity Provider SSL Certificate

  1. Start SimpleSAMLphp by running:

     docker-compose up
    
  2. Navigate to http://localhost:10080/simplesaml/saml2/idp/metadata.php

  3. The contents of the <ds:X509Certificate> element should match the contents of the idp-certificate.pem file under src/main/resources/certs

Login

The available users configured in the Identity Provider are

Username Password
user1 user1pass
user2 user2pass

SP initiated SSO

Access http://localhost:8080 to test SAML 2.0 Single Sign-On initiated by the Service Provider.

IdP initiated SSO

Access http://localhost:10080/simplesaml/saml2/idp/SSOService.php?spentityid=issuer.example.com to test SAML 2.0 Single Sign-On initiated by the Identity Provider.

References

About

Spring Boot with Spring Security SAML 2.0 Login

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages