Download the PHP package asasmoyo/yii2-saml without Composer
On this page you can find all versions of the php package asasmoyo/yii2-saml. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download asasmoyo/yii2-saml
More information about asasmoyo/yii2-saml
Files in asasmoyo/yii2-saml
Package yii2-saml
Short Description Connect Yii 2 application to a Saml Identity Provider for Single Sign On
License MIT
Informations about the package yii2-saml
Yii 2 Saml
Connect Yii 2 application to a Saml Identity Provider for Single Sign On
Installation
The preferred way to install this extension is through composer.
Either run
or add
to the require section of your composer.json
file.
Configuration
Register asasmoyo\yii2saml\Saml
to your components in config/web.php
.
This component requires a OneLogin_Saml
configuration stored in a php file. The default value for configFileName
is @app/config/saml.php
so make sure to create this file before. This file must returns the OneLogin_Saml
configuration. See this link for example configuration.
NOTE : As of version 1.6.0 you can directly put your configuration into your component. For example:
Usage
This extension provides 4 actions:
-
LoginAction
This actions will initiate login process to Identity Provider specified in config file. To use this action, just register this action to your actions in your controller.
The login method can receive seven optional parameters:
$returnTo
- The target URL the user should be returned to after login..$parameters
- An array of parameters that will be added to theGET
in the HTTP-Redirect.$forceAuthn
- When true theAuthNRequest
will set theForceAuthn='true'
$isPassive
- When true theAuthNRequest
will set theIspassive='true'
$strict
- True if we want to stay (returns the url string) False to redirect$setNameIdPolicy
- When true the AuthNRequest will set a nameIdPolicy element.$nameIdValueReq
- Indicates to the IdP the subject that should be authenticated.
Now you can login to your Identity Provider by visiting
saml/login
. -
AcsAction
This action will process saml response sent by Identity Provider after succesfull login. You can register a callback to do some operation like read the attributes sent by Identity Provider and create a new user from that attributes. To use this action just register this action to you controllers's actions.
NOTE: Make sure to register the acs action's url to
AssertionConsumerService
and the sls actions's url toSingleLogoutService
(if supported) in the Identity Provider. -
MetadataAction
This action will show metadata of you application in xml. To use this action, just register the action to your controller's action.
-
LogoutAction
This action will initiate SingleLogout process to Identity Provider. To use this action, just register this action to your controller's actions.
-
SlsAction
This action will process saml logout request/response sent by Identity Provider. To use this action just register this action to you controllers's actions.
Usage
If the SAMLResponse is rejected, add to the SAML settings the parameter
and the reason will be prompted.
LICENCE
MIT Licence