Download the PHP package juhedata/laravel-samlidp without Composer

On this page you can find all versions of the php package juhedata/laravel-samlidp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-samlidp

Latest Version on Packagist Total Downloads

Laravel SAML IdP

This package allows you to implement your own Identification Provider (idP) using the SAML 2.0 standard to be used with supporting SAML 2.0 Service Providers (SP).

该组件可以让你实现基于SAML 2.0协议的IDP端(IDP端提供身份验证,用户在此登录)。

Version

1.0

2.0

Installation

Require this package with composer:

用composer安装本组件:

Publish config

发布配置文件

FileSystem configuration

文件系统配置

Use the following command to create a self signed certificate for your IdP. If you change the certname or keyname to anything other than the default names, you will need to update your config/samlidp.php config file to reflect those new file names.

用以下命令生成自签证书

Usage

Within your login view, probably resources/views/auth/login.blade.php add the SAMLRequest directive beneath the CSRF directive:

在登录页面(如resources/views/auth/login.blade.php),在CSRF directive后增加SAMLRequest directive

The SAMLRequest directive will fill out the hidden input automatically when a SAMLRequest is sent by an HTTP request and therefore initiate a SAML authentication attempt. To initiate the SAML auth, the login and redirect processes need to be intervened. This is done using the Laravel events fired upon authentication.

SAMLRequest directive会自动检查当前的HTTP请求是否含有SAML相关的参数,若有则补充SAML相关的参数到登录的表单中。 相关中间件会处理表单中的SAML请求,并将用户重定向到SP。

Config

After you publish the config file, you will need to set up your Service Providers. The key for the Service Provider is a base 64 encoded Consumer Service (ACS) URL. You can get this information from your Service Provider, but you will need to base 64 encode the URL and place it in your config. This is due to config dot notation.

You may use this command to help generate a new SAML Service Provider:

一个idP可以对应多个SP,用以下命令生成SP配置代码:

Example SP in config/samlidp.php file:

可参考 config/samlidp.php 文件中的SP配置示例:

Log out of IdP after SLO

If you wish to log out of the IdP after SLO has completed, set LOGOUT_AFTER_SLO to true in your .env perform the logout action on the Idp.

Redirect to SLO initiator after logout

If you wish to return the user back to the SP by which SLO was initiated, you may provide an additional query parameter to the /saml/logout route, for example:

After all SP's have been logged out of, the user will be redirected to mysp.com. For this to work properly you need to add the sp_slo_redirects option to your config/samlidp.php config file, for example:

Attributes (optional)

Service providers may require more additional attributes to be sent via assertion. Its even possible that they require the same information but as a different Claim Type.

SP可能要求提供更多的属性。

By Default this package will send the following Claim Types:

ClaimTypes::EMAIL_ADDRESS as auth()->user()->email ClaimTypes::GIVEN_NAME as auth()->user()->name

This is because Laravel migrations, by default, only supply email and name fields that are usable by SAML 2.0.

To add additional Claim Types, you can subscribe to the Assertion event:

CodeGreenCreative\SamlIdp\Events\Assertion

Subscribing to the Event:

可以通过订阅相关事件,来向SP传递更多属性:

In your App\Providers\EventServiceProvider class, add to the already existing $listen property...

App\Providers\EventServiceProvider 中订阅这个事件:CodeGreenCreative\SamlIdp\Events\Assertion

Sample Listener:

Listener示例:


All versions of laravel-samlidp with dependencies

PHP Build Version
Package Version
Requires php Version ^5.6 || ^7.0
illuminate/support Version ^5.0
illuminate/routing Version ^5.0
lightsaml/lightsaml Version ^1.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package juhedata/laravel-samlidp contains the following files

Loading the files please wait ....