Hello,
Apologies for the newbie post, but I have been reading the simpleSAML documentation and what I can find on the internet but am still somewhat struggling to understand how attributes are passed from the IdP to SP. I'm sure what this comes down to is myself just not understanding things correctly, so I was hoping the more experienced users here would be able to help point me in the right direction.
What I am trying to achive:-
- A simpleSAMLphp IdP which uses Radius as an authentication source (I have this working)
- The radius server to return specific attributes to a specific SP i.e. authenticated user's email, authenticated user's company name etc... (This is the part I am having difficulty with)
On the same server as the IdP I have set up default-SP which works and you can log in and it shows you some attributes when you log in. However, I am struggling to understand how I can add some more attributes to this that are pulled from the Radius server (such as email address).
Looking at the Radius module documentation (
https://simplesamlphp.org/docs/1.5/radius:radius), it mentions I need to add a vendor id and vendor. So as a test I have set a "reply" attribute on a test radius user account I am using. I se tthe reply attribute for the
"3com" vendor and the attribute "3com-Product-ID" (this isn't what we'll
use in production, I just wanted to use an existing Vendor/attribute
for development/testing). I set a value of "12" to this with the "="
operator.
I then tried adding the below to authsources.php, saml20-idp-hosted.php and saml20-sp-remote.php but couldn't figure out the right place to put it or if I implemented it correctly.
'attribute_vendor' => 43,
'attribute_vendor_type' => 255,
Below is what I currently have configured in case someone can identify where I am going wrong. Could anyone advise the newbie on how I can include the reply attributes from radius in the SAML assertion so the SP can see them?
Thanks in advance for any insight or help!
authsources.php
'companyradius' => array(
'radius:Radius',
'servers' => array('hostname' => '<radiusserver>',
'port' => <radiusserverport>,
'secret' => '<secretkeyforradius>'
),
'timeout' => 5,
'retries' => 3,
'username_attribute' => 'User-Name',
),
metadata/saml20-idp-hosted.php -
The hardcoded "mail" attribute here (in italic) was to test a login to a development SP to see if it could be integrated with the simpleSAML IdP (which worked), this is obviously hardcoded at the moment and an example of what I want to pull from Radius for the authenticated user
$metadata['__DYNAMIC:1__'] = array(
'host' => '__DEFAULT__',
'privatekey' => '<privatekeyfile>.pem',
'certificate' => '<certificatefile>.crt',
'auth' => 'companyradius',
'RelayState' => '<our site>',
'signature.algorithm' => 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256',
'authproc' => array(
60 => array(
'class' => 'core:AttributeAdd',
'%replace',
'mail' => array('bl...@blah.com'),
),
),
);metadata/saml20-sp-remote.php -
Like above, the hardcoded "mail" attribute here (in italic) was to test a login to a
development SP to see if it could be integrated with the simpleSAML IdP
(which worked), this is obviously hardcoded at the moment and an
example of what I want to pull from Radius for the authenticated user
$metadata[<SP-1>] = array (
'entityid' => '<SP-1>',
'NameIDFormat' => 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress',
'simplesaml.nameidattribute' => 'mail',
'AssertionConsumerService' =>
array (
0 =>
array (
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST',
'Location' => '<SP-LOGIN URL>',
'index' => 0,
'isDefault' => true,
),
1 =>
array (
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact',
'Location' => '<SP-LOGIN URL>',
'index' => 1,
'isDefault' => true,
),
),
'SingleLogoutService' =>
array (
0 =>
array (
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact',
'Location' => '<IDP LOGOUT>',
),
1 =>
array (
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST',
'Location' => '<IDP LOGOUT>',
),
),
'keys' =>
array (
0 =>
array (
'encryption' => false,
'signing' => true,
'type' => 'X509Certificate',
'X509Certificate' => <CERTDATA> ),
),
);