2016-03-15 23 views
8
ile SAML tabanlı SSO

Ben php web uygulamasından biri için SAML tabanlı SSO uygularım. Google'ı IDP olarak kullanıyorum. Laravel 5 - Saml2 eklentisini kullandım ve belgelerinde verilen adımlara göre yapılandırdım. Ayrıca bu uygulamayı google yönetici konsoluna SAML uygulaması olarak here verilen adımları kullanarak ve saml2_settings.php dosyasında entityId ve acs url olarak ekledim. Ancak x509cert sertifikalarını yapılandıramıyorum. Ben giriş url çarptığında, kullanıcı ı kimlik bilgilerini girdiğinde ancak uygulamaya geri gelir ve aşağıdaki hatayı vererek değil, kimlik doğrulama için google yönlendirildiğinde:Laravel

'sp' => array(

    // Specifies constraints on the name identifier to be used to 
    // represent the requested subject. 
    // Take a look on lib/Saml2/Constants.php to see the NameIdFormat supported 
    'NameIDFormat' => 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent', 

    // Usually x509cert and privateKey of the SP are provided by files placed at 
    // the certs folder. But we can also provide them with the following parameters 
    'x509cert' => 'I ADDED x509certs here which I downloaded from google', 
    'privateKey' => '', 

    //LARAVEL - You don't need to change anything else on the sp 
    // Identifier of the SP entity (must be a URI) 
    'entityId' => 'snipeit', //LARAVEL: This would be set to saml_metadata route 
    // Specifies info about where and how the <AuthnResponse> message MUST be 
    // returned to the requester, in this case our SP. 
    'assertionConsumerService' => array(
     // URL Location where the <Response> from the IdP will be returned 
     'url' => 'http://dev.sb.com/snipeit/public/account/profile', //LARAVEL: This would be set to saml_acs route 
     //SAML protocol binding to be used when returning the <Response> 
     //message. Onelogin Toolkit supports for this endpoint the 
     //HTTP-Redirect binding only 
     'binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST', 
    ), 
    // Specifies info about where and how the <Logout Response> message MUST be 
    // returned to the requester, in this case our SP. 
    'singleLogoutService' => array(
     // URL Location where the <Response> from the IdP will be returned 
     'url' => '', //LARAVEL: This would be set to saml_sls route 
     // SAML protocol binding to be used when returning the <Response> 
     // message. Onelogin Toolkit supports for this endpoint the 
     // HTTP-Redirect binding only 
     'binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect', 
    ), 
), 

// Identity Provider Data that we want connect with our SP 
'idp' => array(
    // Identifier of the IdP entity (must be a URI) 
    'entityId' => '', 
    // SSO endpoint info of the IdP. (Authentication Request protocol) 
    'singleSignOnService' => array(
     // URL Target of the IdP where the SP will send the Authentication Request Message 
     'url' => $idp_host, 
     // SAML protocol binding to be used when returning the <Response> 
     // message. Onelogin Toolkit supports for this endpoint the 
     // HTTP-POST binding only 
     'binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect', 
    ), 
    // SLO endpoint info of the IdP. 
    'singleLogoutService' => array(
     // URL Location of the IdP where the SP will send the SLO Request 
     'url' => $idp_host . '/saml2/idp/SingleLogoutService.php', 
     // SAML protocol binding to be used when returning the <Response> 
     // message. Onelogin Toolkit supports for this endpoint the 
     // HTTP-Redirect binding only 
     'binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect', 
    ), 
    // Public x509 certificate of the IdP 
    'x509cert' => 'SAME CERTIFICATES I ADDED HERE AS WELL',  /* 
    * Instead of use the whole x509cert you can use a fingerprint 
    * (openssl x509 -noout -fingerprint -in "idp.crt" to generate it) 
    */ 
    // 'certFingerprint' => '', 
), 
: Aşağıdaki

  1. That’s an error.

Error: app_not_configured_for_user

Service is not configured for this user.

benim saml2_settings dosyasıdır

Birisi bana yardım edebilir.

cevap

3

'sp' => array(

'x509cert' => 'I ADDED x509certs here which I downloaded from google', 
'privateKey' => '', 

Google'ı IdP olarak kullanıyorsunuz, bu nedenle sp nedeninde google public cert'i kullanıyorsunuz?

SP tarafından gönderilen SAML iletilerini imzalamayı planlıyorsanız, o zaman kendi cert/private anahtarınızı yerleştirmeniz gerekir. Bu araç ile otomatik olarak imzalanan sertifikalar oluşturabilir:

bazı ayarlar alanlar hakkında şüpheniz varsa https://www.samltool.com/self_signed_certs.php, documentation of php-saml, eklenti kullanan SAML araç gözden da Lavarel SAML Eklentinin belgeleri gözden ama. ne olup bittiğini hatalarını gidermek üzere

, ben de size, SAML Mesajları kaydetmek için bir tarayıcı uzantısı kullanın örneğin SAML Tracer için kullanmak ve olası bir hata hakkında bilgilendirecektir yanıtların durumu tekrar gözden geçirilmesi önerilmektedir.

+0

Smartin, Laravel 5'deki SAML2 hakkında çok şey biliyor gibisiniz. Bu konuda bana yardımcı olabilir misiniz? http://stackoverflow.com/questions/42396868/laravel-5-integrate-with-saml-2-with-existing-idp – ihue