Skip to content

Instantly share code, notes, and snippets.

@dorian-e3
Created May 10, 2020 22:43
Show Gist options
  • Save dorian-e3/fff78b4c91076601c89f6e2540c645bd to your computer and use it in GitHub Desktop.
Save dorian-e3/fff78b4c91076601c89f6e2540c645bd to your computer and use it in GitHub Desktop.
<?php
/**
* SAML 2.0 remote IdP metadata for SimpleSAMLphp.
*
* Remember to remove the IdPs you don't use from this file.
*
* See: https://simplesamlphp.org/docs/stable/simplesamlphp-reference-idp-remote
*/
/**
* Environment based switching at bottom of file
*/
$metadata['https://sts.windows.net/sample/'] = [
'entityid' => 'https://sts.windows.net/sample/',
'metadata-set' => 'saml20-idp-remote',
'sign.authnrequest' => true,
'SingleSignOnService' =>
[
[
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',
'Location' => 'https://login.microsoftonline.com/sample/saml2',
],
[
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST',
'Location' => 'https://login.microsoftonline.com/sample/saml2',
]
],
'SingleLogoutService' =>
[
[
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',
'Location' => 'https://login.microsoftonline.com/sample/saml2',
],
],
'certificate' => 'sample.cer',
];
/**
* Env based switching
*/
// Acquia dev
if(isset($_ENV['AH_SITE_ENVIRONMENT']) && $_ENV['AH_SITE_ENVIRONMENT'] == 'dev') {
$metadata['https://sts.windows.net/sample/']['certificate'] = 'sample2.cer';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment