<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Splunk SSO with SAML2 SimpleSAMLPHP as Idp and apache2 2.22 as reverse proxy and mod-auth-mellon 0.9 on it as SP not working [SOLVED] in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-SSO-with-SAML2-SimpleSAMLPHP-as-Idp-and-apache2-2-22-as/m-p/111506#M23359</link>
    <description>&lt;P&gt;Here is the detailed explanation:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;1. Splunk server configuration&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;1.1. Installed Splunk 6.2.1 with Developer license on 192.168.111.10&lt;/P&gt;

&lt;P&gt;1.2.    /opt/splunk/etc/system/local/web.conf&lt;BR /&gt;
Note: with 192.168.111.14 the Apache server’s IP address &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;# Remote user HTTP header sent by the authenticating proxy server.
# This header should be set to the authenticated user.
remoteUser = X-Remote-User

# SSO mode.
# Allows SSO to behave in either permissive or strict mode.
# Permissive: Users may login to splunkweb using a valid splunk account
# even if they are coming from a non trusted IP.
# Strict: All requests to splunkweb will be restricted to those originating
# from a trusted IP except those to endpoints not requiring authentication.
#
# allowed values: strict, permissive
# default: strict.
#
SSOMode = strict

# Trusted IP.  This is the IP address of the authenticating proxy.
# Splunkweb verifies it is receiving data from the proxy host for all
# SSO requests.
# Set in local/web.conf a valid IP address to enable SSO.
#
# trustedIP = 127.0.0.1
trustedIP = 127.0.0.1, 192.168.111.14, 192.168.111.10
# If set to 1, and if appServerPorts is set to a non-zero value, this
# will allow SSO to work even if server.conf doesn't have a trustedIP
# set (it still needs to be set in web.conf)
allowSsoWithoutChangingServerConf = 1

# Top level name for the site
root_endpoint = /splunk
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;1.3.    /opt/splunk/etc/system/local/server.conf&lt;BR /&gt;
Note: seems being deprecated as allowSsoWithoutChangingServerConf now in web.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[general]
trustedIP = 192.168.111.14
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;1.4.    Restart splunk service&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;2. Apache server configuration&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;2.1.    Install Debian Wheezy 7.8&lt;/P&gt;

&lt;P&gt;2.2.    Check that the timezone configured is the same than on the PC IdP&lt;/P&gt;

&lt;P&gt;2.3.    Proxy configuration&lt;BR /&gt;
Edit /etc/environment...&lt;/P&gt;

&lt;P&gt;2.4.    Firewall configuration (quite common, but just to make sure the right ports are opened)&lt;BR /&gt;
Edit /etc/iptables-up.rules&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#Common firewall config
*filter
:INPUT DROP [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [189:103951]
-A INPUT ! -i eth0 -j ACCEPT
-A INPUT -p tcp -m tcp --tcp-flags ACK ACK -j ACCEPT
-A INPUT -m state --state ESTABLISHED -j ACCEPT
-A INPUT -m state --state RELATED -j ACCEPT
-A INPUT -p udp -m udp --sport 53 --dport 1024:65535 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 0 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 3 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 4 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 11 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 12 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 113 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -p tcp -m tcp -m multiport --dports 25,587 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 10000:10010 -j ACCEPT
-A INPUT -j LOG
-A FORWARD -j LOG
COMMIT
*mangle
:PREROUTING ACCEPT [49770:4531554]
:INPUT ACCEPT [49770:4531554]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [48931:39133213]
:POSTROUTING ACCEPT [48931:39133213]
COMMIT
*nat
:PREROUTING ACCEPT [4223:278291]
:INPUT ACCEPT [1650:94585]
:OUTPUT ACCEPT [2836:192019]
:POSTROUTING ACCEPT [2836:192019]
COMMIT
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To load these rules to iptables firewall:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;iptables-restore &amp;amp;lt; /etc/iptables.up.rules
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To save iptables firewall active rules:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;iptables-save &amp;amp;gt; /etc/iptables.up.rules
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To load these rules to on startup:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;nano /etc/network/interfaces
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;add to eht0 interface:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;post-up iptables-restore &amp;amp;lt; /etc/iptables.up.rules
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2.5.    Repository configuration to be able to load packages and specifically ‘mod-auth-mellon’ &lt;BR /&gt;
(our SAML2 SP)&lt;/P&gt;

&lt;P&gt;&lt;A href="https://github.com/UNINETT/mod_auth_mellon/wiki/GenericSetup" target="_blank"&gt;https://github.com/UNINETT/mod_auth_mellon/wiki/GenericSetup&lt;/A&gt; &lt;BR /&gt;
&lt;A href="http://backports.debian.org/Instructions/" target="_blank"&gt;http://backports.debian.org/Instructions/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;To have updates and be able to load packages from wheezy repository:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;# to be added in /etc/apt/sources.list :
deb http://ftp.us.debian.org/debian/ wheezy main contrib non-free
deb-src http://ftp.us.debian.org/debian/ wheezy main contrib non-free
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To load libapache2-mod-auth-mellon:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;# to be added in /etc/apt/sources.list :
deb http://http.debian.net/debian wheezy-backports main
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Finally run below command to have this new repository available with command line:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;apt-get update
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2.6.    ssh configuration&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;apt-get install ssh;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2.7.    Load libapache2-mod-auth-mellon&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;apt-get install -t wheezy-backports libapache2-mod-auth-mellon;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2.8.    Mellon SP configuration&lt;BR /&gt;
Create the mellon directory and copy mellon_create_metadata.sh:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/etc/apache2/mellon
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Enable auth-mellon in Apache:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;a2enmod auth_mellon
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Generate the SP metadata:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;cd /etc/apache2/mellon
./mellon_create_metadata.sh urn:splunkweb:simplesamlsample.com http://simplesamlsample.com/secret/endpoint
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note: simplesamlsample.com is the Apache server name which is preserved even after the Splunk redirect.&lt;/P&gt;

&lt;P&gt;The files generated are:&lt;BR /&gt;
 - urn_splunkweb_simplesamlsample.com.xml =&amp;gt; BE CAREFUL HERE, the urls parsed by SimpleSAMLPHP have to end with logout and postResponse as below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;amp;lt;EntityDescriptor entityID="urn:splunkweb:simplesamlsample.com" xmlns="urn:oasis:names:tc:SAML:2.0:metadata" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&amp;amp;gt;
  &amp;amp;lt;SPSSODescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol"&amp;amp;gt;
    &amp;amp;lt;KeyDescriptor use="signing"&amp;amp;gt;
      &amp;amp;lt;ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&amp;amp;gt;
        &amp;amp;lt;ds:X509Data&amp;amp;gt;
          &amp;amp;lt;ds:X509Certificate&amp;amp;gt;MI...RZyv&amp;amp;lt;/ds:X509Certificate&amp;amp;gt;
        &amp;amp;lt;/ds:X509Data&amp;amp;gt;
      &amp;amp;lt;/ds:KeyInfo&amp;amp;gt;
    &amp;amp;lt;/KeyDescriptor&amp;amp;gt;
    &amp;amp;lt;SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="http://simplesamlsample.com/secret/endpoint/logout"/&amp;amp;gt;
    &amp;amp;lt;AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="http://simplesamlsample.com/secret/endpoint/postResponse" index="0"/&amp;amp;gt;
  &amp;amp;lt;/SPSSODescriptor&amp;amp;gt;
&amp;amp;lt;/EntityDescriptor&amp;amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;urn_splunkweb_simplesamlsample.com.cert&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;urn_splunkweb_simplesamlsample.com.key&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;To create the Circle Of Trust between the SP and the IdP:&lt;BR /&gt;
-   Provide the SP metadata file ‘urn_splunkweb_simplesamlsample.com.xml’ to the PC IdP&lt;BR /&gt;
-   Get the PC IdP and copy it in /etc/apache2/mellon with for instance the name: idp-metadata.xml&lt;/P&gt;

&lt;P&gt;Load the rewrite module:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;cp  –f  /etc/apache2/mods-available/rewrite.load   /etc/apache2/mods-enabled/
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Load the headers module:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;cp  –f  /etc/apache2/mods-available/headers.load   /etc/apache2/mods-enabled/
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Load the proxy modules:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;cp  –f  /etc/apache2/mods-available/proxy*   /etc/apache2/mods-enabled/
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Update /etc/apache2/sites-available/default =&amp;gt; BE CAREFUL here, mellon prefixes all the attributes received from the idp with 'MELLON_'. In my case, I wanted to use the email so MELLON_email:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;amp;lt;VirtualHost simplesamlsample.com:80&amp;amp;gt;
    ErrorLog ${APACHE_LOG_DIR}/error.log
    #values: debug, info, notice, warn, error, crit, alert, emerg.
    LogLevel debug 
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    ProxyRequests Off
    ProxyPass /secret/ !
        ProxyPassInterpolateEnv On
        MellonCacheSize 100
    MellonLockFile "/var/lock/mod_auth_mellon/lock"
    &amp;amp;lt;Location /&amp;amp;gt;
        MellonEnable "auth"
        Require valid-user
        AuthType "Mellon"
        MellonVariable "cookie"
        MellonSPPrivateKeyFile  /etc/apache2/mellon/urn_splunkweb_simplesamlsample.com.key
        MellonSPCertFile  /etc/apache2/mellon/urn_splunkweb_simplesamlsample.com.cert
        MellonSPMetadataFile /etc/apache2/mellon/urn_splunkweb_simplesamlsample.com.xml
        MellonIdPMetadataFile /etc/apache2/mellon/idp-metadata.xml
        #MellonUser "email" 
        MellonEndpointPath /secret/endpoint
        MellonDefaultLoginPath /en-US/
        #RequestHeader set X-REMOTE-USER admin  
        RequestHeader set X-REMOTE-USER %{MELLON_email}e
        MellonSamlResponseDump On

        ProxyPass http://192.168.111.10:8000/
            ProxyPassReverse http://192.168.111.10:8000/
            ProxyPassInterpolateEnv On
    &amp;amp;lt;/Location&amp;amp;gt;
&amp;amp;lt;/VirtualHost&amp;amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Restart Apache:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;service apache2 restart
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Open url &lt;A href="http://simplesamlphp.com" target="_blank"&gt;http://simplesamlphp.com&lt;/A&gt; and check the SAML Authn request (SP to Idp) and SAML Authn response (IdP to SP) thanks to the great SAML plugin of Firefox&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;amp;lt;samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
                xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
                ID="_6e....99c"
                Version="2.0"
                IssueInstant="2015-04-02T23:26:07Z"
                Destination="http://simplesamlsample.com/secret/endpoint/postResponse"
                InResponseTo="_A75...C2"
                &amp;amp;gt;
    &amp;amp;lt;saml:Issuer&amp;amp;gt;https://myidpurl.com/saml2/idp/metadata.php&amp;amp;lt;/saml:Issuer&amp;amp;gt;
    &amp;amp;lt;ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&amp;amp;gt;
        &amp;amp;lt;ds:SignedInfo&amp;amp;gt;
            &amp;amp;lt;ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /&amp;amp;gt;
            &amp;amp;lt;ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /&amp;amp;gt;
            &amp;amp;lt;ds:Reference URI="#_6e355ee2e7c2ff009445a9402c9b3291ba4018199c"&amp;amp;gt;
                &amp;amp;lt;ds:Transforms&amp;amp;gt;
                    &amp;amp;lt;ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /&amp;amp;gt;
                    &amp;amp;lt;ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /&amp;amp;gt;
                &amp;amp;lt;/ds:Transforms&amp;amp;gt;
                &amp;amp;lt;ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /&amp;amp;gt;
                &amp;amp;lt;ds:DigestValue&amp;amp;gt;eEzfF....2QJB0=&amp;amp;lt;/ds:DigestValue&amp;amp;gt;
            &amp;amp;lt;/ds:Reference&amp;amp;gt;
        &amp;amp;lt;/ds:SignedInfo&amp;amp;gt;
        &amp;amp;lt;ds:SignatureValue&amp;amp;gt;By4yfd6G...G8/RY=&amp;amp;lt;/ds:SignatureValue&amp;amp;gt;
        &amp;amp;lt;ds:KeyInfo&amp;amp;gt;
            &amp;amp;lt;ds:X509Data&amp;amp;gt;
                &amp;amp;lt;ds:X509Certificate&amp;amp;gt;MII...mO4=&amp;amp;lt;/ds:X509Certificate&amp;amp;gt;
            &amp;amp;lt;/ds:X509Data&amp;amp;gt;
        &amp;amp;lt;/ds:KeyInfo&amp;amp;gt;
    &amp;amp;lt;/ds:Signature&amp;amp;gt;
    &amp;amp;lt;samlp:Status&amp;amp;gt;
        &amp;amp;lt;samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success" /&amp;amp;gt;
    &amp;amp;lt;/samlp:Status&amp;amp;gt;
    &amp;amp;lt;saml:Assertion xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xmlns:xs="http://www.w3.org/2001/XMLSchema"
                    ID="_029....8604"
                    Version="2.0"
                    IssueInstant="201...7Z"
                    &amp;amp;gt;
        &amp;amp;lt;saml:Issuer&amp;amp;gt;https://myidpurl.com/saml2/idp/metadata.php&amp;amp;lt;/saml:Issuer&amp;amp;gt;
        &amp;amp;lt;ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&amp;amp;gt;
            &amp;amp;lt;ds:SignedInfo&amp;amp;gt;
                &amp;amp;lt;ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /&amp;amp;gt;
                &amp;amp;lt;ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /&amp;amp;gt;
                &amp;amp;lt;ds:Reference URI="#_029...04"&amp;amp;gt;
                    &amp;amp;lt;ds:Transforms&amp;amp;gt;
                        &amp;amp;lt;ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /&amp;amp;gt;
                        &amp;amp;lt;ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /&amp;amp;gt;
                    &amp;amp;lt;/ds:Transforms&amp;amp;gt;
                    &amp;amp;lt;ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /&amp;amp;gt;
                    &amp;amp;lt;ds:DigestValue&amp;amp;gt;c3N../kbk=&amp;amp;lt;/ds:DigestValue&amp;amp;gt;
                &amp;amp;lt;/ds:Reference&amp;amp;gt;
            &amp;amp;lt;/ds:SignedInfo&amp;amp;gt;
            &amp;amp;lt;ds:SignatureValue&amp;amp;gt;JVJq....QZI=&amp;amp;lt;/ds:SignatureValue&amp;amp;gt;
            &amp;amp;lt;ds:KeyInfo&amp;amp;gt;
                &amp;amp;lt;ds:X509Data&amp;amp;gt;
                    &amp;amp;lt;ds:X509Certificate&amp;amp;gt;MIIC...VmO4=&amp;amp;lt;/ds:X509Certificate&amp;amp;gt;
                &amp;amp;lt;/ds:X509Data&amp;amp;gt;
            &amp;amp;lt;/ds:KeyInfo&amp;amp;gt;
        &amp;amp;lt;/ds:Signature&amp;amp;gt;
        &amp;amp;lt;saml:Subject&amp;amp;gt;
            &amp;amp;lt;saml:NameID SPNameQualifier="urn:splunkweb:simplesamlsample.com"
                         Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient"
                         &amp;amp;gt;_24ef464490ec9d84315d794d4d21950d4769d9c842&amp;amp;lt;/saml:NameID&amp;amp;gt;
            &amp;amp;lt;saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer"&amp;amp;gt;
                &amp;amp;lt;saml:SubjectConfirmationData NotOnOrAfter="2015-04-02T23:31:07Z"
                                              Recipient="http://simplesamlsample.com/secret/endpoint/postResponse"
                                              InResponseTo="_A75E41690FE1541537F680159A38A3C2"
                                              /&amp;amp;gt;
            &amp;amp;lt;/saml:SubjectConfirmation&amp;amp;gt;
        &amp;amp;lt;/saml:Subject&amp;amp;gt;
        &amp;amp;lt;saml:Conditions NotBefore="2015-04-02T23:25:37Z"
                         NotOnOrAfter="2015-04-02T23:31:07Z"
                         &amp;amp;gt;
            &amp;amp;lt;saml:AudienceRestriction&amp;amp;gt;
                &amp;amp;lt;saml:Audience&amp;amp;gt;urn:splunkweb:simplesamlsample.com&amp;amp;lt;/saml:Audience&amp;amp;gt;
            &amp;amp;lt;/saml:AudienceRestriction&amp;amp;gt;
        &amp;amp;lt;/saml:Conditions&amp;amp;gt;
        &amp;amp;lt;saml:AuthnStatement AuthnInstant="2015-04-02T23:26:07Z"
                             SessionNotOnOrAfter="2015-04-03T07:26:07Z"
                             SessionIndex="_d996...41c"
                             &amp;amp;gt;
            &amp;amp;lt;saml:AuthnContext&amp;amp;gt;                &amp;amp;lt;saml:AuthnContextClassRef&amp;amp;gt;urn:oasis:names:tc:SAML:2.0:ac:classes:Password&amp;amp;lt;/saml:AuthnContextClassRef&amp;amp;gt;
            &amp;amp;lt;/saml:AuthnContext&amp;amp;gt;
        &amp;amp;lt;/saml:AuthnStatement&amp;amp;gt;
        &amp;amp;lt;saml:AttributeStatement&amp;amp;gt;
            &amp;amp;lt;saml:Attribute Name="email"
                            NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"
                            &amp;amp;gt;
                &amp;amp;lt;saml:AttributeValue xsi:type="xs:string"&amp;amp;gt;myemail@mydomain.com&amp;amp;lt;/saml:AttributeValue&amp;amp;gt;
            &amp;amp;lt;/saml:Attribute&amp;amp;gt;
        &amp;amp;lt;/saml:AttributeStatement&amp;amp;gt;
    &amp;amp;lt;/saml:Assertion&amp;amp;gt;
&amp;amp;lt;/samlp:Response&amp;amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You should get routed to Splunk, in my case, &lt;A href="http://simplesamlsample.com/splunk/en-US" target="_blank"&gt;http://simplesamlsample.com/splunk/en-US&lt;/A&gt;... &lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 19:49:40 GMT</pubDate>
    <dc:creator>mikaelt29</dc:creator>
    <dc:date>2020-09-28T19:49:40Z</dc:date>
    <item>
      <title>Splunk SSO with SAML2 SimpleSAMLPHP as Idp and apache2 2.22 as reverse proxy and mod-auth-mellon 0.9 on it as SP not working [SOLVED]</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-SSO-with-SAML2-SimpleSAMLPHP-as-Idp-and-apache2-2-22-as/m-p/111503#M23356</link>
      <description>&lt;P&gt;I have been trying the past days to have Splunk SSO working with SimpleSAMLPHP as IdP without success.&lt;BR /&gt;
I confirm the header X-Remote-User is well set in &lt;A href="http://splunk_example_url.com:8000/splunk/en-US/debu/sso" target="_blank"&gt;http://splunk_example_url.com:8000/splunk/en-US/debu/sso&lt;/A&gt; when I don't  use SAML (so SP mellon and the IdP SimpleSAMLPHP).&lt;BR /&gt;
Then, if I enable mellon, I am first well routed to my SimpleSAMLPHP auth IdP where I log in.&lt;BR /&gt;
But then, it is doing a loop on the redirect to &lt;A href="http://my_apache_splunk_proxy_example_url/splunk/" target="_blank"&gt;http://my_apache_splunk_proxy_example_url/splunk/&lt;/A&gt;, rerouting to my IdP and so on and so forth.&lt;/P&gt;

&lt;P&gt;Did you already experience this kind of problems? &lt;BR /&gt;
Maybe I should not even try because I haven't seen any others tutorial than for Okta, OpenAM and LDAP as SAML2 IdP.&lt;/P&gt;

&lt;P&gt;Here is my configuration:&lt;/P&gt;

&lt;P&gt;I have:&lt;BR /&gt;
-   Splunk 6.2.1 (CentOS): 192.168.111.10&lt;BR /&gt;
-   Apache2 2.22 and mod-auth-mellon 0.9 (Debian): 192.168.111.14 =&amp;gt; simplesamlsample.com&lt;BR /&gt;
-   IdP: 192.168.111.2&lt;/P&gt;

&lt;P&gt;On splunk side:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/opt/splunk/etc/system/local/server.conf
[general]
trustedIP = 192.168.111.14

/opt/splunk/etc/system/local/web.conf
[settings]
remoteUser = X-Remote-User
SSOMode = strict
tools.proxy.on = true   (=&amp;gt; to true, even if it seems it is not necessary anymore with apache2)
trustedIP = 127.0.0.1, 192.168.111.14, 192.168.111.10
allowSsoWithoutChangingServerConf = 1
root_endpoint = /splunk     
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;Test of Apache/Splunk connection OK&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;On Apache server:
/etc/apache2/available-sites/default
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;VIRTUALHOST 80=""&gt;&lt;BR /&gt;
       ServerName simplesamlsample.com&lt;BR /&gt;
       DocumentRoot /var/www/simplesamlsample.com&lt;BR /&gt;
       &lt;DIRECTORY&gt;&lt;BR /&gt;
              Require all granted &lt;BR /&gt;
       &lt;/DIRECTORY&gt;&lt;BR /&gt;
       ErrorLog ${APACHE_LOG_DIR}/error.log&lt;BR /&gt;
       # Possible values include: debug, info, notice, warn, error, crit,&lt;BR /&gt;
       # alert, emerg.&lt;BR /&gt;
       LogLevel debug&lt;BR /&gt;
       CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;/VIRTUALHOST&gt;&lt;/P&gt;

&lt;P&gt;RequestHeader set X-REMOTE-USER admin&lt;BR /&gt;
&lt;PROXY&gt;&lt;BR /&gt;
        Order deny,allow&lt;BR /&gt;
        Allow from all&lt;BR /&gt;
&lt;/PROXY&gt;&lt;BR /&gt;
       ProxyRequests Off&lt;BR /&gt;
       ProxyPreserveHost On&lt;BR /&gt;
       ProxyPassInterpolateEnv On&lt;BR /&gt;
ProxyPass /splunk/ &lt;A href="http://192.168.111.10:8000/splunk/" target="_blank"&gt;http://192.168.111.10:8000/splunk/&lt;/A&gt;&lt;BR /&gt;
ProxyPassReverse /splunk/ &lt;A href="http://192.168.111.10:8000/splunk/" target="_blank"&gt;http://192.168.111.10:8000/splunk/&lt;/A&gt; &lt;BR /&gt;
       ProxyPassReverseCookiePath / /&lt;BR /&gt;
&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;I restarted and I tested this configuration without SAML2 authentication. &lt;BR /&gt;
That means I connect to &lt;A href="http://192.168.111.14/splunk/" target="_blank"&gt;http://192.168.111.14/splunk/&lt;/A&gt; and I get routed to Splunk with right X-Remote-User set (confirmed by using &lt;A href="http://simplesamlsample.com/splunk/debug/sso" target="_blank"&gt;http://simplesamlsample.com/splunk/debug/sso&lt;/A&gt; url). It works like a charm.&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt; Test with mod-auth-mellon SP and SimpleSAMLSample IdP&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;On Apache server:&lt;BR /&gt;
I installed and enabled mod-auth-mellon.&lt;/P&gt;

&lt;P&gt;Thanks to the mellon script, I have generated the certs and metadata for my SP. My metadata:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;./mellon_create_metadata.sh urn:splunkweb:simplesamlsample.com  http://simplesamlsample.com/secret/endpoint
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I modified the endpoint to have the splunk endpoint:&lt;BR /&gt;
&lt;A href="http://simplesamlsample.com/splunk/" target="_blank"&gt;http://simplesamlsample.com/splunk/&lt;/A&gt; &lt;BR /&gt;
// instead of &lt;A href="http://simplesamlsample.com/secret/endpoint/" target="_blank"&gt;http://simplesamlsample.com/secret/endpoint/&lt;/A&gt; &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;EntityDescriptor entityID="urn:splunkweb:simplesamlsample.com" xmlns="urn:oasis:names:tc:SAML:2.0:metadata" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&amp;gt;
  &amp;lt;SPSSODescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol"&amp;gt;
    &amp;lt;KeyDescriptor use="signing"&amp;gt;…&amp;lt;/KeyDescriptor&amp;gt;
    &amp;lt;SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="http://simplesamlsample.com/splunk/"/&amp;gt;
    &amp;lt;AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="http://simplesamlsample.com/splunk/" index="0"/&amp;gt;
  &amp;lt;/SPSSODescriptor&amp;gt;
&amp;lt;/EntityDescriptor&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and then, I’ve submitted the SP metadata to the IdP and I copied these files in the dir I’ve created /etc/apache2/mellon/ with right access ok. In addition to that, I copied my SimpleSAMLPHP IdP's metadata in the same directory as idp-metadata.xml.&lt;/P&gt;

&lt;P&gt;I added the mellon configuration to apache2: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/etc/apache2/available-sites/default
&amp;lt;VirtualHost simplesamlsample.com:80&amp;gt;
       ServerName simplesamlsample.com
       DocumentRoot /var/www/simplesamlsample.com
       &amp;lt;Directory /var/www/simplesamlsample.com&amp;gt;
              Require all granted 
       &amp;lt;/Directory&amp;gt;
       ErrorLog ${APACHE_LOG_DIR}/error.log
       # Possible values include: debug, info, notice, warn, error, crit,
       # alert, emerg.
       LogLevel debug
       CustomLog ${APACHE_LOG_DIR}/access.log combined

       RequestHeader set X-REMOTE-USER admin
       &amp;lt;Proxy *&amp;gt;
        Order deny,allow
        Allow from all
       &amp;lt;/Proxy&amp;gt;
       ProxyRequests Off
       ProxyPreserveHost On
       ProxyPassInterpolateEnv On
       ProxyPass /splunk/ http://192.168.111.10:8000/splunk/
       ProxyPassReverse /splunk/ http://192.168.111.10:8000/splunk/ 
       ProxyPassReverseCookiePath / /

       MellonCacheSize 100
       MellonLockFile "/var/lock/mod_auth_mellon/lock"
       &amp;lt;Location /&amp;gt;
              # Add information from the auth_mellon session to the request.
              MellonEnable "auth"
              Require valid-user
              AuthType "Mellon"
              MellonVariable "mellon-cookie"
              MellonSamlResponseDump On
              # Configure the SP metadata
              # This should be the files which were created when creating SP metadata.
              MellonSPPrivateKeyFile  /etc/apache2/mellon/urn_splunkweb_simplesamlsample.com.key
              MellonSPCertFile  /etc/apache2/mellon/urn_splunkweb_simplesamlsample.com.cert
              MellonSPMetadataFile /etc/apache2/mellon/urn_splunkweb_simplesamlsample.com.xml
              # IdP metadata. This should be the metadata file you downloaded from the IdP.
              MellonIdPMetadataFile /etc/apache2/mellon/idp-metadata.xml
              #MellonUser "email"  
              # this is the property coming on the SAML assertion set as REMOTE_USER
              # MellonUser "username"
              # The location all endpoints should be located under.
              # It is the URL to this location that is used as the second parameter to the metadata generation script.
              # This path is relative to the root of the web server.
              MellonEndpointPath /mellon
              # Options +FollowSymLinks

              RequestHeader set X-REMOTE-USER admin #=&amp;gt; Trying this way first                     

       &amp;lt;/Location&amp;gt;
&amp;lt;/VirtualHost&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then, I restarted the apache server. I am well routed to the IdP when I open &lt;A href="http://simplesamlsample.com" target="_blank"&gt;http://simplesamlsample.com&lt;/A&gt;. I do the authentication on it and then I am routed to the address &lt;A href="http://simplesamlsample.com/splunk/" target="_blank"&gt;http://simplesamlsample.com/splunk/&lt;/A&gt;. For now, I don’t care the attributes I get. That’s why I set X-Remote-User with a supposed to be working hardcoded value.&lt;/P&gt;

&lt;P&gt;Unfortunately, after logging on the IdP, I get rerouted to the IdP authentication already done so then the security warning (because still no https). I have an infinite loop on the warning screen.&lt;/P&gt;

&lt;P&gt;Would you have an idea?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:18:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-SSO-with-SAML2-SimpleSAMLPHP-as-Idp-and-apache2-2-22-as/m-p/111503#M23356</guid>
      <dc:creator>mikaelt29</dc:creator>
      <dc:date>2020-09-28T19:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk SSO with SAML2 SimpleSAMLPHP as Idp and apache2 2.22 as reverse proxy and mod-auth-mellon 0.9 on it as SP not working [SOLVED]</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-SSO-with-SAML2-SimpleSAMLPHP-as-Idp-and-apache2-2-22-as/m-p/111504#M23357</link>
      <description>&lt;P&gt;I finally made it worked!! I will post the details of my config very soon.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2015 16:43:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-SSO-with-SAML2-SimpleSAMLPHP-as-Idp-and-apache2-2-22-as/m-p/111504#M23357</guid>
      <dc:creator>mikaelt29</dc:creator>
      <dc:date>2015-04-02T16:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk SSO with SAML2 SimpleSAMLPHP as Idp and apache2 2.22 as reverse proxy and mod-auth-mellon 0.9 on it as SP not working [SOLVED]</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-SSO-with-SAML2-SimpleSAMLPHP-as-Idp-and-apache2-2-22-as/m-p/111505#M23358</link>
      <description>&lt;P&gt;Can you please post how you got it working? Facing same issue,Can you tell how was this done?I am having same issue &lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2015 23:38:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-SSO-with-SAML2-SimpleSAMLPHP-as-Idp-and-apache2-2-22-as/m-p/111505#M23358</guid>
      <dc:creator>rohitp92</dc:creator>
      <dc:date>2015-05-01T23:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk SSO with SAML2 SimpleSAMLPHP as Idp and apache2 2.22 as reverse proxy and mod-auth-mellon 0.9 on it as SP not working [SOLVED]</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-SSO-with-SAML2-SimpleSAMLPHP-as-Idp-and-apache2-2-22-as/m-p/111506#M23359</link>
      <description>&lt;P&gt;Here is the detailed explanation:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;1. Splunk server configuration&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;1.1. Installed Splunk 6.2.1 with Developer license on 192.168.111.10&lt;/P&gt;

&lt;P&gt;1.2.    /opt/splunk/etc/system/local/web.conf&lt;BR /&gt;
Note: with 192.168.111.14 the Apache server’s IP address &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;# Remote user HTTP header sent by the authenticating proxy server.
# This header should be set to the authenticated user.
remoteUser = X-Remote-User

# SSO mode.
# Allows SSO to behave in either permissive or strict mode.
# Permissive: Users may login to splunkweb using a valid splunk account
# even if they are coming from a non trusted IP.
# Strict: All requests to splunkweb will be restricted to those originating
# from a trusted IP except those to endpoints not requiring authentication.
#
# allowed values: strict, permissive
# default: strict.
#
SSOMode = strict

# Trusted IP.  This is the IP address of the authenticating proxy.
# Splunkweb verifies it is receiving data from the proxy host for all
# SSO requests.
# Set in local/web.conf a valid IP address to enable SSO.
#
# trustedIP = 127.0.0.1
trustedIP = 127.0.0.1, 192.168.111.14, 192.168.111.10
# If set to 1, and if appServerPorts is set to a non-zero value, this
# will allow SSO to work even if server.conf doesn't have a trustedIP
# set (it still needs to be set in web.conf)
allowSsoWithoutChangingServerConf = 1

# Top level name for the site
root_endpoint = /splunk
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;1.3.    /opt/splunk/etc/system/local/server.conf&lt;BR /&gt;
Note: seems being deprecated as allowSsoWithoutChangingServerConf now in web.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[general]
trustedIP = 192.168.111.14
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;1.4.    Restart splunk service&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;2. Apache server configuration&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;2.1.    Install Debian Wheezy 7.8&lt;/P&gt;

&lt;P&gt;2.2.    Check that the timezone configured is the same than on the PC IdP&lt;/P&gt;

&lt;P&gt;2.3.    Proxy configuration&lt;BR /&gt;
Edit /etc/environment...&lt;/P&gt;

&lt;P&gt;2.4.    Firewall configuration (quite common, but just to make sure the right ports are opened)&lt;BR /&gt;
Edit /etc/iptables-up.rules&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#Common firewall config
*filter
:INPUT DROP [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [189:103951]
-A INPUT ! -i eth0 -j ACCEPT
-A INPUT -p tcp -m tcp --tcp-flags ACK ACK -j ACCEPT
-A INPUT -m state --state ESTABLISHED -j ACCEPT
-A INPUT -m state --state RELATED -j ACCEPT
-A INPUT -p udp -m udp --sport 53 --dport 1024:65535 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 0 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 3 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 4 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 11 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 12 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 113 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -p tcp -m tcp -m multiport --dports 25,587 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 10000:10010 -j ACCEPT
-A INPUT -j LOG
-A FORWARD -j LOG
COMMIT
*mangle
:PREROUTING ACCEPT [49770:4531554]
:INPUT ACCEPT [49770:4531554]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [48931:39133213]
:POSTROUTING ACCEPT [48931:39133213]
COMMIT
*nat
:PREROUTING ACCEPT [4223:278291]
:INPUT ACCEPT [1650:94585]
:OUTPUT ACCEPT [2836:192019]
:POSTROUTING ACCEPT [2836:192019]
COMMIT
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To load these rules to iptables firewall:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;iptables-restore &amp;amp;lt; /etc/iptables.up.rules
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To save iptables firewall active rules:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;iptables-save &amp;amp;gt; /etc/iptables.up.rules
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To load these rules to on startup:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;nano /etc/network/interfaces
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;add to eht0 interface:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;post-up iptables-restore &amp;amp;lt; /etc/iptables.up.rules
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2.5.    Repository configuration to be able to load packages and specifically ‘mod-auth-mellon’ &lt;BR /&gt;
(our SAML2 SP)&lt;/P&gt;

&lt;P&gt;&lt;A href="https://github.com/UNINETT/mod_auth_mellon/wiki/GenericSetup" target="_blank"&gt;https://github.com/UNINETT/mod_auth_mellon/wiki/GenericSetup&lt;/A&gt; &lt;BR /&gt;
&lt;A href="http://backports.debian.org/Instructions/" target="_blank"&gt;http://backports.debian.org/Instructions/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;To have updates and be able to load packages from wheezy repository:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;# to be added in /etc/apt/sources.list :
deb http://ftp.us.debian.org/debian/ wheezy main contrib non-free
deb-src http://ftp.us.debian.org/debian/ wheezy main contrib non-free
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To load libapache2-mod-auth-mellon:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;# to be added in /etc/apt/sources.list :
deb http://http.debian.net/debian wheezy-backports main
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Finally run below command to have this new repository available with command line:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;apt-get update
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2.6.    ssh configuration&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;apt-get install ssh;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2.7.    Load libapache2-mod-auth-mellon&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;apt-get install -t wheezy-backports libapache2-mod-auth-mellon;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2.8.    Mellon SP configuration&lt;BR /&gt;
Create the mellon directory and copy mellon_create_metadata.sh:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/etc/apache2/mellon
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Enable auth-mellon in Apache:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;a2enmod auth_mellon
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Generate the SP metadata:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;cd /etc/apache2/mellon
./mellon_create_metadata.sh urn:splunkweb:simplesamlsample.com http://simplesamlsample.com/secret/endpoint
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note: simplesamlsample.com is the Apache server name which is preserved even after the Splunk redirect.&lt;/P&gt;

&lt;P&gt;The files generated are:&lt;BR /&gt;
 - urn_splunkweb_simplesamlsample.com.xml =&amp;gt; BE CAREFUL HERE, the urls parsed by SimpleSAMLPHP have to end with logout and postResponse as below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;amp;lt;EntityDescriptor entityID="urn:splunkweb:simplesamlsample.com" xmlns="urn:oasis:names:tc:SAML:2.0:metadata" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&amp;amp;gt;
  &amp;amp;lt;SPSSODescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol"&amp;amp;gt;
    &amp;amp;lt;KeyDescriptor use="signing"&amp;amp;gt;
      &amp;amp;lt;ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&amp;amp;gt;
        &amp;amp;lt;ds:X509Data&amp;amp;gt;
          &amp;amp;lt;ds:X509Certificate&amp;amp;gt;MI...RZyv&amp;amp;lt;/ds:X509Certificate&amp;amp;gt;
        &amp;amp;lt;/ds:X509Data&amp;amp;gt;
      &amp;amp;lt;/ds:KeyInfo&amp;amp;gt;
    &amp;amp;lt;/KeyDescriptor&amp;amp;gt;
    &amp;amp;lt;SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="http://simplesamlsample.com/secret/endpoint/logout"/&amp;amp;gt;
    &amp;amp;lt;AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="http://simplesamlsample.com/secret/endpoint/postResponse" index="0"/&amp;amp;gt;
  &amp;amp;lt;/SPSSODescriptor&amp;amp;gt;
&amp;amp;lt;/EntityDescriptor&amp;amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;urn_splunkweb_simplesamlsample.com.cert&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;urn_splunkweb_simplesamlsample.com.key&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;To create the Circle Of Trust between the SP and the IdP:&lt;BR /&gt;
-   Provide the SP metadata file ‘urn_splunkweb_simplesamlsample.com.xml’ to the PC IdP&lt;BR /&gt;
-   Get the PC IdP and copy it in /etc/apache2/mellon with for instance the name: idp-metadata.xml&lt;/P&gt;

&lt;P&gt;Load the rewrite module:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;cp  –f  /etc/apache2/mods-available/rewrite.load   /etc/apache2/mods-enabled/
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Load the headers module:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;cp  –f  /etc/apache2/mods-available/headers.load   /etc/apache2/mods-enabled/
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Load the proxy modules:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;cp  –f  /etc/apache2/mods-available/proxy*   /etc/apache2/mods-enabled/
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Update /etc/apache2/sites-available/default =&amp;gt; BE CAREFUL here, mellon prefixes all the attributes received from the idp with 'MELLON_'. In my case, I wanted to use the email so MELLON_email:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;amp;lt;VirtualHost simplesamlsample.com:80&amp;amp;gt;
    ErrorLog ${APACHE_LOG_DIR}/error.log
    #values: debug, info, notice, warn, error, crit, alert, emerg.
    LogLevel debug 
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    ProxyRequests Off
    ProxyPass /secret/ !
        ProxyPassInterpolateEnv On
        MellonCacheSize 100
    MellonLockFile "/var/lock/mod_auth_mellon/lock"
    &amp;amp;lt;Location /&amp;amp;gt;
        MellonEnable "auth"
        Require valid-user
        AuthType "Mellon"
        MellonVariable "cookie"
        MellonSPPrivateKeyFile  /etc/apache2/mellon/urn_splunkweb_simplesamlsample.com.key
        MellonSPCertFile  /etc/apache2/mellon/urn_splunkweb_simplesamlsample.com.cert
        MellonSPMetadataFile /etc/apache2/mellon/urn_splunkweb_simplesamlsample.com.xml
        MellonIdPMetadataFile /etc/apache2/mellon/idp-metadata.xml
        #MellonUser "email" 
        MellonEndpointPath /secret/endpoint
        MellonDefaultLoginPath /en-US/
        #RequestHeader set X-REMOTE-USER admin  
        RequestHeader set X-REMOTE-USER %{MELLON_email}e
        MellonSamlResponseDump On

        ProxyPass http://192.168.111.10:8000/
            ProxyPassReverse http://192.168.111.10:8000/
            ProxyPassInterpolateEnv On
    &amp;amp;lt;/Location&amp;amp;gt;
&amp;amp;lt;/VirtualHost&amp;amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Restart Apache:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;service apache2 restart
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Open url &lt;A href="http://simplesamlphp.com" target="_blank"&gt;http://simplesamlphp.com&lt;/A&gt; and check the SAML Authn request (SP to Idp) and SAML Authn response (IdP to SP) thanks to the great SAML plugin of Firefox&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;amp;lt;samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
                xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
                ID="_6e....99c"
                Version="2.0"
                IssueInstant="2015-04-02T23:26:07Z"
                Destination="http://simplesamlsample.com/secret/endpoint/postResponse"
                InResponseTo="_A75...C2"
                &amp;amp;gt;
    &amp;amp;lt;saml:Issuer&amp;amp;gt;https://myidpurl.com/saml2/idp/metadata.php&amp;amp;lt;/saml:Issuer&amp;amp;gt;
    &amp;amp;lt;ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&amp;amp;gt;
        &amp;amp;lt;ds:SignedInfo&amp;amp;gt;
            &amp;amp;lt;ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /&amp;amp;gt;
            &amp;amp;lt;ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /&amp;amp;gt;
            &amp;amp;lt;ds:Reference URI="#_6e355ee2e7c2ff009445a9402c9b3291ba4018199c"&amp;amp;gt;
                &amp;amp;lt;ds:Transforms&amp;amp;gt;
                    &amp;amp;lt;ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /&amp;amp;gt;
                    &amp;amp;lt;ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /&amp;amp;gt;
                &amp;amp;lt;/ds:Transforms&amp;amp;gt;
                &amp;amp;lt;ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /&amp;amp;gt;
                &amp;amp;lt;ds:DigestValue&amp;amp;gt;eEzfF....2QJB0=&amp;amp;lt;/ds:DigestValue&amp;amp;gt;
            &amp;amp;lt;/ds:Reference&amp;amp;gt;
        &amp;amp;lt;/ds:SignedInfo&amp;amp;gt;
        &amp;amp;lt;ds:SignatureValue&amp;amp;gt;By4yfd6G...G8/RY=&amp;amp;lt;/ds:SignatureValue&amp;amp;gt;
        &amp;amp;lt;ds:KeyInfo&amp;amp;gt;
            &amp;amp;lt;ds:X509Data&amp;amp;gt;
                &amp;amp;lt;ds:X509Certificate&amp;amp;gt;MII...mO4=&amp;amp;lt;/ds:X509Certificate&amp;amp;gt;
            &amp;amp;lt;/ds:X509Data&amp;amp;gt;
        &amp;amp;lt;/ds:KeyInfo&amp;amp;gt;
    &amp;amp;lt;/ds:Signature&amp;amp;gt;
    &amp;amp;lt;samlp:Status&amp;amp;gt;
        &amp;amp;lt;samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success" /&amp;amp;gt;
    &amp;amp;lt;/samlp:Status&amp;amp;gt;
    &amp;amp;lt;saml:Assertion xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xmlns:xs="http://www.w3.org/2001/XMLSchema"
                    ID="_029....8604"
                    Version="2.0"
                    IssueInstant="201...7Z"
                    &amp;amp;gt;
        &amp;amp;lt;saml:Issuer&amp;amp;gt;https://myidpurl.com/saml2/idp/metadata.php&amp;amp;lt;/saml:Issuer&amp;amp;gt;
        &amp;amp;lt;ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&amp;amp;gt;
            &amp;amp;lt;ds:SignedInfo&amp;amp;gt;
                &amp;amp;lt;ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /&amp;amp;gt;
                &amp;amp;lt;ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /&amp;amp;gt;
                &amp;amp;lt;ds:Reference URI="#_029...04"&amp;amp;gt;
                    &amp;amp;lt;ds:Transforms&amp;amp;gt;
                        &amp;amp;lt;ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /&amp;amp;gt;
                        &amp;amp;lt;ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /&amp;amp;gt;
                    &amp;amp;lt;/ds:Transforms&amp;amp;gt;
                    &amp;amp;lt;ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /&amp;amp;gt;
                    &amp;amp;lt;ds:DigestValue&amp;amp;gt;c3N../kbk=&amp;amp;lt;/ds:DigestValue&amp;amp;gt;
                &amp;amp;lt;/ds:Reference&amp;amp;gt;
            &amp;amp;lt;/ds:SignedInfo&amp;amp;gt;
            &amp;amp;lt;ds:SignatureValue&amp;amp;gt;JVJq....QZI=&amp;amp;lt;/ds:SignatureValue&amp;amp;gt;
            &amp;amp;lt;ds:KeyInfo&amp;amp;gt;
                &amp;amp;lt;ds:X509Data&amp;amp;gt;
                    &amp;amp;lt;ds:X509Certificate&amp;amp;gt;MIIC...VmO4=&amp;amp;lt;/ds:X509Certificate&amp;amp;gt;
                &amp;amp;lt;/ds:X509Data&amp;amp;gt;
            &amp;amp;lt;/ds:KeyInfo&amp;amp;gt;
        &amp;amp;lt;/ds:Signature&amp;amp;gt;
        &amp;amp;lt;saml:Subject&amp;amp;gt;
            &amp;amp;lt;saml:NameID SPNameQualifier="urn:splunkweb:simplesamlsample.com"
                         Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient"
                         &amp;amp;gt;_24ef464490ec9d84315d794d4d21950d4769d9c842&amp;amp;lt;/saml:NameID&amp;amp;gt;
            &amp;amp;lt;saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer"&amp;amp;gt;
                &amp;amp;lt;saml:SubjectConfirmationData NotOnOrAfter="2015-04-02T23:31:07Z"
                                              Recipient="http://simplesamlsample.com/secret/endpoint/postResponse"
                                              InResponseTo="_A75E41690FE1541537F680159A38A3C2"
                                              /&amp;amp;gt;
            &amp;amp;lt;/saml:SubjectConfirmation&amp;amp;gt;
        &amp;amp;lt;/saml:Subject&amp;amp;gt;
        &amp;amp;lt;saml:Conditions NotBefore="2015-04-02T23:25:37Z"
                         NotOnOrAfter="2015-04-02T23:31:07Z"
                         &amp;amp;gt;
            &amp;amp;lt;saml:AudienceRestriction&amp;amp;gt;
                &amp;amp;lt;saml:Audience&amp;amp;gt;urn:splunkweb:simplesamlsample.com&amp;amp;lt;/saml:Audience&amp;amp;gt;
            &amp;amp;lt;/saml:AudienceRestriction&amp;amp;gt;
        &amp;amp;lt;/saml:Conditions&amp;amp;gt;
        &amp;amp;lt;saml:AuthnStatement AuthnInstant="2015-04-02T23:26:07Z"
                             SessionNotOnOrAfter="2015-04-03T07:26:07Z"
                             SessionIndex="_d996...41c"
                             &amp;amp;gt;
            &amp;amp;lt;saml:AuthnContext&amp;amp;gt;                &amp;amp;lt;saml:AuthnContextClassRef&amp;amp;gt;urn:oasis:names:tc:SAML:2.0:ac:classes:Password&amp;amp;lt;/saml:AuthnContextClassRef&amp;amp;gt;
            &amp;amp;lt;/saml:AuthnContext&amp;amp;gt;
        &amp;amp;lt;/saml:AuthnStatement&amp;amp;gt;
        &amp;amp;lt;saml:AttributeStatement&amp;amp;gt;
            &amp;amp;lt;saml:Attribute Name="email"
                            NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"
                            &amp;amp;gt;
                &amp;amp;lt;saml:AttributeValue xsi:type="xs:string"&amp;amp;gt;myemail@mydomain.com&amp;amp;lt;/saml:AttributeValue&amp;amp;gt;
            &amp;amp;lt;/saml:Attribute&amp;amp;gt;
        &amp;amp;lt;/saml:AttributeStatement&amp;amp;gt;
    &amp;amp;lt;/saml:Assertion&amp;amp;gt;
&amp;amp;lt;/samlp:Response&amp;amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You should get routed to Splunk, in my case, &lt;A href="http://simplesamlsample.com/splunk/en-US" target="_blank"&gt;http://simplesamlsample.com/splunk/en-US&lt;/A&gt;... &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:49:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-SSO-with-SAML2-SimpleSAMLPHP-as-Idp-and-apache2-2-22-as/m-p/111506#M23359</guid>
      <dc:creator>mikaelt29</dc:creator>
      <dc:date>2020-09-28T19:49:40Z</dc:date>
    </item>
  </channel>
</rss>

