Skip to content

Instantly share code, notes, and snippets.

@dorian-e3
Created May 10, 2020 22:19
Show Gist options
  • Save dorian-e3/8464486152192969b3a95660f2539350 to your computer and use it in GitHub Desktop.
Save dorian-e3/8464486152192969b3a95660f2539350 to your computer and use it in GitHub Desktop.
Saml Authsources Config Sample
/**
* Enviornment specific changes made at bottom of file
*/
$config = [
// For logging into saml admin pages
'admin' => [
'core:AdminPassword',
],
// SAML 2.0 Authentication Configuration
'default-sp' => [
'saml:SP',
// Don't send NameIDPolicy per request of IDP
'NameIDPolicy' => FALSE,
// The entity ID of this SP.
'entityID' => 'https://www.enviornment-specific-drupal-domain.com',
// The entity ID of the IdP this SP should contact.
// Normally an address
'idp' => "https://sts.windows.net/sample/",
// Private key you generate yourself in cert directory
// openssl req -newkey rsa:3072 -new -x509 -days 3652 -nodes -out saml.crt -keyout saml.pem
'privatekey' => 'sample.pem',
],
];
/*
* Enviornment specific switching if SSO is enabled on multiple enviornments
*/
if(isset($_ENV['AH_SITE_ENVIRONMENT']) && $_ENV['AH_SITE_ENVIRONMENT'] == 'prod') {
$config['default-sp']['entityID'] = 'https://www.sample.com';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment