diff --git a/docs/source/simplesamlphp-idp.xml b/docs/source/simplesamlphp-idp.xml
index f62bb7d7e289a569a28bfe893174b59a12cf052e..53c800442d1c0e5528ec9eb989ab521ad01ac6dd 100644
--- a/docs/source/simplesamlphp-idp.xml
+++ b/docs/source/simplesamlphp-idp.xml
@@ -385,6 +385,36 @@ openssl x509 -req -days 60 -in server2.csr -signkey server2.key -out server2.crt
               <literal>eduPersonPrincipalName</literal>.</para>
             </glossdef>
           </glossentry>
+
+          <glossentry>
+            <glossterm>SingleSignOnService</glossterm>
+
+            <glossdef>
+              <para>Override the default URL for the SingleSignOnService
+              for this IdP. This is an absolute URL. The default value is
+              <literal>&lt;simpleSAMLphp-root&gt;/saml2/idp/SSOService.php</literal></para>
+
+              <para>Note that this only changes the values in the generated
+              metadata and in the messages sent to others. You must also
+              configure your webserver to deliver this URL to the correct
+              PHP page.</para>
+            </glossdef>
+          </glossentry>
+
+          <glossentry>
+            <glossterm>SingleLogoutService</glossterm>
+
+            <glossdef>
+              <para>Override the default URL for the SingleLogoutService
+              for this IdP. This is an absolute URL. The default value is
+              <literal>&lt;simpleSAMLphp-root&gt;/saml2/idp/SingleLogoutService.php</literal></para>
+
+              <para>Note that this only changes the values in the generated
+              metadata and in the messages sent to others. You must also
+              configure your webserver to deliver this URL to the correct
+              PHP page.</para>
+            </glossdef>
+          </glossentry>
         </glosslist>
       </section>
 
diff --git a/docs/source/simplesamlphp-sp.xml b/docs/source/simplesamlphp-sp.xml
index 7e2f8c03862fef14397af3827f6d4455cf8d705d..6c6df9fe3987211780954351bf07880facaa4a77 100644
--- a/docs/source/simplesamlphp-sp.xml
+++ b/docs/source/simplesamlphp-sp.xml
@@ -256,6 +256,36 @@
               default for this SP.</para>
             </glossdef>
           </glossentry>
+
+          <glossentry>
+            <glossterm>AssertionConsumerService</glossterm>
+
+            <glossdef>
+              <para>Override the default URL for the AssertionConsumerService
+              for this SP. This is an absolute URL. The default value is
+              <literal>&lt;simpleSAMLphp-root&gt;/saml2/sp/AssertionConsumerService.php</literal></para>
+
+              <para>Note that this only changes the values in the generated
+              metadata and in the messages sent to others. You must also
+              configure your webserver to deliver this URL to the correct
+              PHP page.</para>
+            </glossdef>
+          </glossentry>
+
+          <glossentry>
+            <glossterm>SingleLogoutService</glossterm>
+
+            <glossdef>
+              <para>Override the default URL for the SingleLogoutService
+              for this SP. This is an absolute URL. The default value is
+              <literal>&lt;simpleSAMLphp-root&gt;/saml2/sp/SingleLogoutService.php</literal></para>
+
+              <para>Note that this only changes the values in the generated
+              metadata and in the messages sent to others. You must also
+              configure your webserver to deliver this URL to the correct
+              PHP page.</para>
+            </glossdef>
+          </glossentry>
         </glosslist>
       </section>
 
@@ -635,6 +665,29 @@
           </glossentry>
         </glosslist>
       </section>
+
+      <section>
+        <title>Optional metadata fields</title>
+
+        <para>These fields can be left out if not needed.</para>
+
+        <glosslist>
+          <glossentry>
+            <glossterm>AssertionConsumerService</glossterm>
+
+            <glossdef>
+              <para>Override the default URL for the AssertionConsumerService
+              for this SP. This is an absolute URL. The default value is
+              <literal>&lt;simpleSAMLphp-root&gt;/shib13/sp/AssertionConsumerService.php</literal></para>
+
+              <para>Note that this only changes the values in the generated
+              metadata and in the messages sent to others. You must also
+              configure your webserver to deliver this URL to the correct
+              PHP page.</para>
+            </glossdef>
+          </glossentry>
+        </glosslist>
+      </section>
     </section>
 
     <section>
diff --git a/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php b/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php
index 9398679a8fb36a7144857d1aa788187cea772db6..3ec00ebd5e927f017cbfa10b7265d6a67a372abe 100644
--- a/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php
+++ b/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php
@@ -91,6 +91,16 @@ class SimpleSAML_Metadata_MetaDataStorageHandler {
 	 * @return The autogenerated metadata property.
 	 */
 	public function getGenerated($property, $set = 'saml20-sp-hosted') {
+
+		/* First we check if the user has overridden this property in the metadata. */
+		try {
+			$metadataSet = $this->getMetaDataCurrent($set);
+			if(array_key_exists($property, $metadataSet)) {
+				return $metadataSet[$property];
+			}
+		} catch(Exception $e) {
+			/* Probably metadata wasn't found. In any case we continue by generating the metadata. */
+		}
 		
 		/* Get the configuration. */
 		$config = SimpleSAML_Configuration::getInstance();