aacotroneo / laravel-saml2

A Laravel 5 package for Saml2 integration as a SP (service provider) based on the simple OneLogin toolkit
MIT License
565 stars 237 forks source link

simplesamlphp #75

Open bunlongheng opened 7 years ago

bunlongheng commented 7 years ago

In your configuration section,

You guys said, "if you use simplesamlphp, add the following to /metadata/sp-remote.php"

I'm a little confuse right now, since this is my first time implementing this integration.

Does that mean I have to pre-installed simplesampleid in order to use this package ?

Also, I saw you start using http://laravel_url/ in

$metadata['http://laravel_url/saml/metadata'] = array(
    'AssertionConsumerService' => 'http://laravel_url/saml/acs',
    'SingleLogoutService' => 'http://laravel_url/saml/sls',
    //the following two affect what the $Saml2user->getUserId() will return
    'NameIDFormat' => 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent',
    'simplesaml.nameidattribute' => 'uid' 
);

What is that ? How do I get that ?

I am not implementing the iDP. I got the end point from the IT guy. In that case, should I request for ACS, and SLS URL too ?

Are those manditory for these 2 lines ?

    'AssertionConsumerService' => 'http://laravel_url/saml/acs',
    'SingleLogoutService' => 'http://laravel_url/saml/sls',

Any hints / suggestions will mean a lot to me !!

ajithd-lbit commented 7 years ago

Hi, I guess I can help you on this. From the description that you had provided, I assume that you want to configure your app as a service provider. That is, use the user details from the iDP to authenticate users in your Laravel app. In that case, you need to configure the details corresponding to the singleSignOnService, singleLogoutService and entityId details in the saml2_settings.php file provided with this package. These details can be obtained from the iDP metadata. For example

   $idp_hostname = 'winmaster.vagrant.atomia.com';
   'idp' => array(
    'entityId' => 'http://'.$idp_hostname.'/adfs/services/trust',
    // SSO endpoint info of the IdP.
    'singleSignOnService' => array(

        'url' => 'https://'.$idp_hostname.'/adfs/ls/',

        'binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',
    ),
    // SLO endpoint info of the IdP.
    'singleLogoutService' => array(

        'url' => 'https://'.$idp_hostname.'/adfs/ls/',

        'binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',
    ),
    // Public x509 certificate of the IdP
    'x509cert' =>'CERTIFICATE DATA HERE',
       ),
bunlongheng commented 7 years ago

@ajithd-lbit : Sorry for late reply. Thank-you very much for your help. Now, I know where are those information are coming from.

bunlongheng commented 7 years ago

@ajithd-lbit : You seem to know a lot of about SAML. I hope you don't mind help me look into the issue that I had here at : https://github.com/aacotroneo/laravel-saml2/issues/77