settings.dist.php 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <?php
  2. /* For license terms, see /license.txt */
  3. exit;
  4. $spBaseUrl = api_get_path(WEB_PATH).'plugin/keycloak/';
  5. $url = 'http://localhost:8080/';
  6. $realm = 'master';
  7. $path = '/path';
  8. $certificate = file_get_contents($path);
  9. $settingsInfo = [
  10. 'strict' => false,
  11. 'debug' => true,
  12. 'sp' => [
  13. 'entityId' => $spBaseUrl.'metadata.php',
  14. 'assertionConsumerService' => [
  15. 'url' => $spBaseUrl.'start.php?acs',
  16. ],
  17. 'singleLogoutService' => [
  18. 'url' => $spBaseUrl.'start.php?sls',
  19. ],
  20. 'NameIDFormat' => 'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified',
  21. ],
  22. 'idp' => [
  23. 'entityId' => $url.'auth/realms/'.$realm, // Example http://localhost:8080/auth/realms/master
  24. 'singleSignOnService' => [
  25. 'url' => $url.'auth/realms/'.$realm.'/protocol/saml', // example http://localhost:8080/auth/realms/master/protocol/saml
  26. ],
  27. 'singleLogoutService' => [
  28. 'url' => $url.'auth/realms/'.$realm.'/protocol/saml', // example http://localhost:8080/auth/realms/master/protocol/saml
  29. ],
  30. 'x509cert' => $certificate,
  31. ],
  32. ];
  33. // advanced settings
  34. //
  35. //
  36. //// Compression settings
  37. //'compress' => array (
  38. // 'requests' => true,
  39. // 'responses' => true
  40. //),
  41. // // Security settings
  42. // 'security' => array (
  43. //
  44. // /** signatures and encryptions offered */
  45. //
  46. // // Indicates that the nameID of the <samlp:logoutRequest> sent by this SP
  47. // // will be encrypted.
  48. // 'nameIdEncrypted' => false,
  49. //
  50. // // Indicates whether the <samlp:AuthnRequest> messages sent by this SP
  51. // // will be signed. [Metadata of the SP will offer this info]
  52. // 'authnRequestsSigned' => false,
  53. //
  54. // // Indicates whether the <samlp:logoutRequest> messages sent by this SP
  55. // // will be signed.
  56. // 'logoutRequestSigned' => false,
  57. //
  58. // // Indicates whether the <samlp:logoutResponse> messages sent by this SP
  59. // // will be signed.
  60. // 'logoutResponseSigned' => false,
  61. //
  62. // /* Sign the Metadata
  63. // False || True (use sp certs) || array (
  64. // keyFileName => 'metadata.key',
  65. // certFileName => 'metadata.crt'
  66. // )
  67. // */
  68. // 'signMetadata' => false,
  69. //
  70. // /** signatures and encryptions required **/
  71. //
  72. // // Indicates a requirement for the <samlp:Response>, <samlp:LogoutRequest>
  73. // // and <samlp:LogoutResponse> elements received by this SP to be signed.
  74. // 'wantMessagesSigned' => false,
  75. //
  76. // // Indicates a requirement for the <saml:Assertion> elements received by
  77. // // this SP to be encrypted.
  78. // 'wantAssertionsEncrypted' => false,
  79. //
  80. // // Indicates a requirement for the <saml:Assertion> elements received by
  81. // // this SP to be signed. [Metadata of the SP will offer this info]
  82. // 'wantAssertionsSigned' => false,
  83. //
  84. // // Indicates a requirement for the NameID element on the SAMLResponse
  85. // // received by this SP to be present.
  86. // 'wantNameId' => true,
  87. //
  88. // // Indicates a requirement for the NameID received by
  89. // // this SP to be encrypted.
  90. // 'wantNameIdEncrypted' => false,
  91. //
  92. // // Authentication context.
  93. // // Set to false and no AuthContext will be sent in the AuthNRequest.
  94. // // Set true or don't present this parameter and you will get an AuthContext 'exact' 'urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport'.
  95. // // Set an array with the possible auth context values: array ('urn:oasis:names:tc:SAML:2.0:ac:classes:Password', 'urn:oasis:names:tc:SAML:2.0:ac:classes:X509').
  96. // 'requestedAuthnContext' => true,
  97. //
  98. // // Indicates if the SP will validate all received xmls.
  99. // // (In order to validate the xml, 'strict' and 'wantXMLValidation' must be true).
  100. // 'wantXMLValidation' => true,
  101. //
  102. // // If true, SAMLResponses with an empty value at its Destination
  103. // // attribute will not be rejected for this fact.
  104. // 'relaxDestinationValidation' => false,
  105. //
  106. // // Algorithm that the toolkit will use on signing process. Options:
  107. // // 'http://www.w3.org/2000/09/xmldsig#rsa-sha1'
  108. // // 'http://www.w3.org/2000/09/xmldsig#dsa-sha1'
  109. // // 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256'
  110. // // 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha384'
  111. // // 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha512'
  112. // // Notice that sha1 is a deprecated algorithm and should not be used
  113. // 'signatureAlgorithm' => 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256',
  114. //
  115. // // Algorithm that the toolkit will use on digest process. Options:
  116. // // 'http://www.w3.org/2000/09/xmldsig#sha1'
  117. // // 'http://www.w3.org/2001/04/xmlenc#sha256'
  118. // // 'http://www.w3.org/2001/04/xmldsig-more#sha384'
  119. // // 'http://www.w3.org/2001/04/xmlenc#sha512'
  120. // // Notice that sha1 is a deprecated algorithm and should not be used
  121. // 'digestAlgorithm' => 'http://www.w3.org/2001/04/xmlenc#sha256',
  122. //
  123. // // ADFS URL-Encodes SAML data as lowercase, and the toolkit by default uses
  124. // // uppercase. Turn it True for ADFS compatibility on signature verification
  125. // 'lowercaseUrlencoding' => false,
  126. //),
  127. //
  128. // // Contact information template, it is recommended to supply a
  129. // // technical and support contacts.
  130. // 'contactPerson' => array (
  131. // 'technical' => array (
  132. // 'givenName' => 'example',
  133. // 'emailAddress' => 'test@example.org'
  134. // ),
  135. // 'support' => array (
  136. // 'givenName' => 'example',
  137. // 'emailAddress' => 'test@example.org'
  138. // ),
  139. //),
  140. //
  141. // // Organization information template, the info in en_US lang is
  142. // // recomended, add more if required.
  143. // 'organization' => array (
  144. // 'en-US' => array(
  145. // 'name' => 'chamilo',
  146. // 'displayname' => 'chamilo',
  147. // 'url' => 'chamilo.org'
  148. // ),
  149. //),