-
Notifications
You must be signed in to change notification settings - Fork 7
Saml2Test testapp with SimpleSAMLphp
Timothy Legge edited this page Feb 17, 2023
·
1 revision
- mkdir ~/simplesamlphp-docker
- cd ~/simplesamlphp-docker
- mkdir -p ~/simplesamlphp-docker/config
docker run -p 9080:8080 -p 9443:8443 --name simplesaml --rm -d kristophjunge/test-saml-idp
docker cp simplesaml:/var/www/simplesamlphp/config/authsources.php config/authsources.php
docker cp simplesaml:/var/www/simplesamlphp/metadata/saml20-sp-remote.php config/saml20-sp-remote.php
- Connect to https://netsaml2-testapp.local and download the metadata.xml
- Connect to https://localhost:9443/simplesaml/admin/metadata-converter.php
- Login with username admin and password secret.
- Either copy the metadata content into the field or select the metadata.xml file and click parse
- Copy the output to a file until needed
docker stop simplesaml
- vim config/saml20-sp-remote.php
- copy the entire converted metadata.xml to the end of the file
- add 'sign.logout' => true, after 'saml20.sign.assertion' => true,
- add the following diff to a file named /tmp/authsources.php.diff
+++ b/config/authsources.php 2023-02-14 21:41:12.523344963 -0400
@@ -12,11 +12,21 @@
'uid' => array('1'),
'eduPersonAffiliation' => array('group1'),
'email' => 'user1@example.com',
+ 'FirstName' => 'User',
+ 'LastName' => 'Name 1',
+ 'Address' => '123 First Street',
+ 'PhoneNumber' => '506-867-5309',
+ 'EmployeeNumber' => '1001',
),
'user2:user2pass' => array(
'uid' => array('2'),
'eduPersonAffiliation' => array('group2'),
'email' => 'user2@example.com',
+ 'FirstName' => 'User',
+ 'LastName' => 'Name 2',
+ 'Address' => '456 Second Street',
+ 'PhoneNumber' => '709-867-5309',
+ 'EmployeeNumber' => '1002',
`),
`),
- patch -p1 < /tmp/authsources.php.diff
- docker-compose -f docker-compose.yml up -d
version: '3'
services:
opensaml:
image: kristophjunge/test-saml-idp
restart: always
ports:
- "9080:8080"
- "9443:8443"
`volumes:
- ./config/authsources.php:/var/www/simplesamlphp/config/authsources.php:z
- ./config/saml20-sp-remote.php:/var/www/simplesamlphp/metadata/saml20-sp-remote.php:z
- cd ~/perl-Net-SAML2/xt/testapp
- mkdir -p IdPs/simplesamlphp
- curl --insecure https://localhost:9443/simplesaml/saml2/idp/metadata.php -o IdPs/simplesamlphp/metadata.xml
- curl --insecure https://localhost:9443/simplesaml/module.php/saml/idp/certs.php/idp.crt -o IdPs/simplesamlphp/cacert.pem
- Create the following file IdPs/simplesamlphp/mappings.yml
EmailAddress: "email"
FirstName: "FirstName"
LastName: "LastName"
Address: "Address"
PhoneNumber: "PhoneNumber"
EmployeeNumber: "EmployeeNumber"
- Access https://netsaml2-testapp.local
- Click simplesamlphp
- Login to simplesamlphp with username user1 and user1pass or user1 and user2pass