Skip to content

Commit 1960fb6

Browse files
committed
Initial import
1 parent 6be4ab4 commit 1960fb6

File tree

18 files changed

+981
-0
lines changed

18 files changed

+981
-0
lines changed

.codecov.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
coverage:
2+
status:
3+
project: yes
4+
5+
comment:
6+
layout: "diff"
7+
behavior: once
8+
require_changes: true
9+
require_base: no
10+
require_head: yes
11+
branches: null

.php_cs.dist

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
$finder = PhpCsFixer\Finder::create()
3+
->in([
4+
__DIR__ . '/lib',
5+
__DIR__ . '/tests',
6+
])
7+
;
8+
return PhpCsFixer\Config::create()
9+
->setRules([
10+
'@PSR2' => true,
11+
'@PSR4' => true,
12+
'@PSR5' => true,
13+
])
14+
->setFinder($finder)
15+
;

.travis.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
sudo: required
2+
3+
language: php
4+
5+
php:
6+
- 5.5
7+
- 5.6
8+
- 7.0
9+
- 7.1
10+
- 7.2
11+
- 7.3
12+
13+
env:
14+
- SIMPLESAMLPHP_VERSION=1.17.*
15+
16+
matrix:
17+
allow_failures:
18+
- php: 7.3
19+
20+
before_script:
21+
- composer require "simplesamlphp/simplesamlphp:${SIMPLESAMLPHP_VERSION}" --no-update
22+
- composer update --no-interaction
23+
- if [[ "$TRAVIS_PHP_VERSION" == "7.3" ]]; then composer require --dev vimeo/psalm; fi
24+
25+
script:
26+
- bin/check-syntax.sh
27+
- if [[ "$TRAVIS_PHP_VERSION" == "5.6" ]]; then php vendor/phpunit/phpunit/phpunit; else php vendor/phpunit/phpunit/phpunit --no-coverage; fi
28+
- if [[ "$TRAVIS_PHP_VERSION" == "7.3" ]]; then vendor/bin/psalm; fi
29+
30+
after_success:
31+
# Codecov, need to edit bash uploader for incorrect TRAVIS_PYTHON_VERSION environment variable matching, at least until codecov/codecov-bash#133 is resolved
32+
- curl -s https://codecov.io/bash > .codecov
33+
- sed -i -e 's/TRAVIS_.*_VERSION/^TRAVIS_.*_VERSION=/' .codecov
34+
- chmod +x .codecov
35+
- if [[ $TRAVIS_PHP_VERSION == "5.6" ]]; then ./.codecov -X gcov; fi
36+
# - if [[ "$TRAVIS_PHP_VERSION" == "5.6" ]]; then bash <(curl -s https://codecov.io/bash); fi

bin/check-syntax.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
PHP='/usr/bin/env php'
4+
RETURN=0
5+
6+
# check PHP files
7+
for FILE in `find lib templates tests www -name "*.php"`; do
8+
$PHP -l $FILE > /dev/null 2>&1
9+
if [ $? -ne 0 ]; then
10+
echo "Syntax check failed for ${FILE}"
11+
RETURN=`expr ${RETURN} + 1`
12+
fi
13+
done
14+
15+
exit $RETURN

default-enable

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This file indicates that the default state of this module
2+
is enabled. To disable, create a file named disable in the
3+
same directory as this file.

docs/adfs.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
Enables AD FS IdP
2+
Compatible with VS 2012 Identity and Access
3+
4+
Basic Setup Companion based on:
5+
http://simplesamlphp.org/docs/stable/simplesamlphp-idp
6+
7+
1. Enabling the Identity Provider functionality
8+
9+
In config/config.php, the option will be:
10+
'enable.adfs-idp' => true
11+
12+
2. Authentication module
13+
14+
Follow as is.
15+
16+
3. Configuring the authentication module
17+
18+
In addition to enabling authentication module, enable adfs module by creating a file named 'enable' in modules/adfs
19+
20+
In unix from installation directory:
21+
touch modules/adfs/enable
22+
23+
4. Configuring the IdP
24+
25+
ADFS IdP is configured by metadata stored in /metadata/adfs-idp-hosted.php and metadata/adfs-sp-remote.php
26+
27+
If they are not present, copy them from /metadata-templates to the metadata
28+
directory.
29+
30+
5. Using the uri NameFormat on attributes
31+
32+
WS-FED likes a few parameters to be very specifically named. This is
33+
especially true if .net clients will be treating this as a Microsoft ADFS
34+
IdP.
35+
36+
The recommended settings for /metadata/adfs-idp-hosted.php is:
37+
38+
'authproc' => array(
39+
// Convert LDAP names to WS-Fed Claims.
40+
100 => array('class' => 'core:AttributeMap', 'name2claim'),
41+
),
42+
43+
6. Adding SPs to the IdP
44+
45+
The minimal configuration for /metadata/adfs-sp-remote.php is:
46+
47+
$metadata['urn:federation:localhost'] = array(
48+
'prp' => 'https://localhost/adfs/ls/',
49+
);
50+
51+
7. Creating a SSL self signed certificate
52+
53+
Follow as is.
54+
55+
8. Adding this IdP to other SPs
56+
57+
Metadata should be available from /module.php/adfs/idp/metadata.php
58+
59+
9. This module tries its best to emulate a Microsoft ADFS endpoint, and as
60+
such, it is simplest to test using a .net client.
61+
62+
To build the test client, follow the tutorial at:
63+
http://code.msdn.microsoft.com/Claims-Aware-Web-d94a89ca
64+
65+
This will build a .net app that uses a dev machine running STS (their name for
66+
an IdP).
67+
68+
To point to your SimpleSamlPHP ADFS IdP, in VS 2012:
69+
70+
a. Right-click the project in Solution Explorer and select the Identity and
71+
Access option.
72+
73+
b. In the Identity and Access Window, Select Use a business identity
74+
provider.
75+
76+
c. Under “Enter the path to the STS metadata document” enter the url you have
77+
78+
from step 8. Something like
79+
https://.../module.php/adfs/idp/metadata.php
80+
81+
d. Click Ok
82+
83+
For more information in regards to .NET: http://msdn.microsoft.com/en-us/library/hh377151.aspx

0 commit comments

Comments
 (0)