定制 simplesamlphp/saml2 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

simplesamlphp/saml2

最新稳定版本:v6.0.1

Composer 安装命令:

composer require simplesamlphp/saml2

包简介

SAML2 PHP library from SimpleSAMLphp

README 文档

README

CI Scrutinizer Code Quality Coverage Status Type coverage Psalm Level

A PHP library for SAML2 related functionality.

It is used by several products, most notably SimpleSAMLphp and OpenConext.

Before you use it

DO NOT USE THIS LIBRARY UNLESS YOU ARE INTIMATELY FAMILIAR WITH THE SAML2 SPECIFICATION.

If you are not familiar with the SAML2 specification and are simply looking to connect your application using SAML2, you should probably use SimpleSAMLphp.

Note that the HTTP Artifact Binding and SOAP client do not work outside of SimpleSAMLphp.

Which version to pick?

The latest released version (4.x range) is the preferred version. The 3.x branch is our LTS branch and will be supported as long as supported releases of SimpleSAMLphp are using this branch.

All other branches (3.x and earlier) are no longer supported and will not receive any maintenance or (security) fixes. Do not use these versions.

We conform to Semantic Versioning. Be sure to check the UPGRADING.md file if you are upgrading from an older version. Here you will find instructions on how to deal with BC breaking changes between versions.

Usage

  • Install with Composer, run the following command in your project:
composer require simplesamlphp/saml2:^4.0
  • Provide the required external dependencies by extending and implementing the \SimpleSAML\SAML2\Compat\AbstractContainer then injecting it in the ContainerSingleton (see example below).

  • Make sure you've read the security section below.

  • Use at will.

Example:

    // Use Composers autoloading
    require 'vendor/autoload.php';

    // Implement the Container interface (out of scope for example)
    require 'container.php';
    \SimpleSAML\SAML2\Compat\ContainerSingleton::setContainer($container);

    // Create Issuer
    $issuer = new \SimpleSAML\SAML2\XML\saml\Issuer('https://sp.example.edu');

    // Instantiate SAML2 Random utils
    $randomUtils = new \SimpleSAML\SAML2\Utils\Random();

    // Set up an AuthnRequest
    $request = new \SimpleSAML\SAML2\XML\samlp\AuthnRequest(
        $issuer,
        $randomUtils->generateId(),
        null,
        'https://idp.example.edu'
    );

    // Send it off using the HTTP-Redirect binding
    $binding = new \SimpleSAML\SAML2\HTTPRedirect();
    $binding->send($request);

License

This library is licensed under the LGPL license version 2.1. For more details see LICENSE.

统计信息

  • 总下载量: 16.48M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 302
  • 点击次数: 1
  • 依赖项目数: 39
  • 推荐数: 0

GitHub 信息

  • Stars: 301
  • Watchers: 34
  • Forks: 136
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-2.1-or-later
  • 更新时间: 2026-01-04