-
Notifications
You must be signed in to change notification settings - Fork 2
Usage example #1
Description
Hi Ivan,
I need to get a SAML implemetation going in my zf2 app and found this module. Do you have any example how to get this going? As far as I know, somewhere I have to specify the identity provider and I cannot see an exampe of that in your README.
I am quite unfamiliar with SAML, but I guess if a user is not logged in, he should be redirected to the identity provider's login page. Will this piece of code do that?
$adapter = new \ZfcShib\Authentication\Adapter\Shibboleth(array(
'id_attr_name' => 'eppn',
'user_attr_names' => array(
'eppn',
'cn',
'mail'
)
));
$result = $adapter->authenticate();As you state, system_attr_names is optional, but I have to specify the IP url there?
$adapter = new \ZfcShib\Authentication\Adapter\Shibboleth(array(
'id_attr_name' => 'eppn',
'user_attr_names' => array(
'eppn',
'cn',
'mail'
),
'system_attr_names' => array(
'Shib-Identity-Provider' => 'https://idp.example.org/idp/shibboleth'
)
));
$result = $adapter->authenticate();Or if the user is not authenticated, the result will be a failure and I have to redirect the user to https://idp.example.org/idp/login or so myself? Also, how can $_SERVER come into play here, shouldn't it be the Zend\Http\Request?
As you see, I am quite uncertain about SAML :)