【问题标题】:Intergrating SimpleSAMLPHP to an application将 SimpleSAMLPHP 集成到应用程序
【发布时间】:2012-09-18 06:45:07
【问题描述】:

我正在尝试将 simpleSAMLphp 与我的 symfony 应用程序集成。我的服务提供商是一个外部应用程序。我的应用程序作为身份提供者工作。

我将 simpleSAMLphp 配置为在不检查身份验证的情况下返回一些属性。 我不知道如何从我的应用程序发起 idp 请求,所以我只是从 saml2/idp/SSOService.php 复制了以下副本。

require_once('ServiceProvider/ssp/www/_include.php');

\SimpleSAML_Logger::info('SAML2.0 -...e');


$metadata = \SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();

$_GET['spentityid']='https://saml.serviceprovider.example.com';

$idpEntityId = $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted');

$idp = \SimpleSAML_IdP::getById('saml2:' . $idpEntityId);

\sspmod_saml_IdP_SAML2::receiveAuthnRequest($idp);


assert('FALSE');

但它给出了一个错误

in /lib/SAML2/Binding.php at line 95        
            throw new Exception('Unable to find the current binding.');

at SAML2_Binding ::getCurrentBinding () modules/saml/lib/IdP/SAML2.php at line 285 
at sspmod_saml_IdP_SAML2 ::receiveAuthnRequest (object(SimpleSAML_IdP))

有人知道如何从应用程序发起 idp 请求吗?

【问题讨论】:

    标签: symfony1 single-sign-on saml federated-identity


    【解决方案1】:

    API 记录在the SP API reference

    我们首先加载一个使用自动加载器注册 simpleSAMLphp 类的文件。调整路径以指向您的 ssp 目录(取决于您的应用所在的位置)

    require_once('../../lib/_autoload.php');
    

    我们选择我们的身份验证源。将ldap-auth 替换为您选择的身份验证源。

    $as = new SimpleSAML_Auth_Simple('ldap-auth');
    

    然后我们需要身份验证:

    $as->requireAuth();
    

    并打印属性:

    $attributes = $as->getAttributes();
    print_r($attributes);
    

    其他选项也可用。 查看the SP API reference 的文档以获取所有参数的列表。

    【讨论】:

      猜你喜欢
      • 2014-10-22
      • 1970-01-01
      • 1970-01-01
      • 2019-01-27
      • 2012-04-24
      • 2017-12-25
      • 2023-03-18
      • 2012-02-04
      • 1970-01-01
      相关资源
      最近更新 更多