arietimmerman / laravel-saml
Laravel SAML 身份提供者包
v0.5.6
2022-11-03 20:26 UTC
Requires
- php: >=7.0.0
- illuminate/auth: ^6.0|^7.0|^8.0|^9.0
- illuminate/console: ^6.0|^7.0|^8.0|^9.0
- illuminate/container: ^6.0|^7.0|^8.0|^9.0
- illuminate/contracts: ^6.0|^7.0|^8.0|^9.0
- illuminate/database: ^6.0|^7.0|^8.0|^9.0
- illuminate/encryption: ^6.0|^7.0|^8.0|^9.0
- illuminate/hashing: ^6.0|^7.0|^8.0|^9.0
- illuminate/http: ^6.0|^7.0|^8.0|^9.0
- illuminate/support: ^6.0|^7.0|^8.0|^9.0
- robrichards/xmlseclibs: ^3.0
- simplesamlphp/saml2: ^4.3
- symfony/workflow: ^6.0
Requires (Dev)
This package is auto-updated.
Last update: 2024-08-30 01:32:22 UTC
README
Laravel 的 SAML
这是一个使用 PHP 和 Laravel 编写的 SAML 身份提供者,基于 simplesamlphp/simplesamlphp 以及 adactive-sas/saml2-bridge-bundle
的部分代码构建。
它被 idaas.nl 使用:(不是)另一个身份即服务平台。
这个库(特别是文档)还在开发中
安装
composer require arietimmerman/laravel-saml
生成密钥对。
openssl req -new -x509 -days 3652 -nodes -out public.key -keyout private.key
排除 URL 的 CSRF 保护
class VerifyCsrfToken extends Middleware
{
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
'/saml/v2/*'
];
}
在你的 routes/web.php
文件中包含以下内容。
ArieTimmerman\Laravel\SAML\RouteProvider::routes();
在登录时,执行以下操作
Helper::getSAMLStateOrFail()->setAuthnContext(Constants::AC_KERBEROS);
Helper::saveSAMLState();
重定向到以下地址
'http://www.ice.test/saml/v2/continue/' . Helper::getSAMLStateOrFail()->id;
示例请求
http://samlidp.dev/saml/v2/login?SAMLRequest=...