dev-master
9999999-devGeneral UserProvider bundle for shibboleth bundle
MIT
The Requires
by Gyula SzabĂł
authorization bundle shibboleth userprovider
General UserProvider bundle for shibboleth bundle
The bundle provides roles for authenticated users according SAML entitlement attributes in $_SERVER variables., (*1)
You can define regexp for ROLE_ADMIN, ROLE_USER, ROLE_GUEST and ROLE_whatever what you get from entitlement value., (*2)
Then you can implement access control as symfony does., (*3)
Insert lines above to composer.json
:, (*4)
... "repositories": [ { "type": "vcs", "url": "git@dev.niif.hu:gyufi/shibbolethuserproviderbundle.git" } ], ...
Install the bundle,, (*5)
composer require niif/shibboleth-user-provider-bundle
Update app/AppKernel.php
, (*6)
$bundles = array( ... new KULeuven\ShibbolethBundle\ShibbolethBundle(), new Niif\ShibbolethUserProviderBundle\NiifShibbolethUserProviderBundle(), ... );
Configure the shibboleth bundle as you see in https://github.com/rmoreas/ShibbolethBundle., (*7)
Configure the user provider., (*8)
FALSE
.""
.ROLE_USER
./^admin$/
/^user$/
/^guest$/
update your app/config/config.yml
, (*9)
... niif_shibboleth_user_provider: entitlement_serverparameter: %shibboleth_user_provider_entitlement_serverparameter% entitlement_prefix: %shibboleth_user_provider_entitlement_prefix% generate_custom_roles: %shibboleth_user_provider_generate_custom_roles% # custom_role_prefix: %shibboleth_user_provider_custom_role_prefix% # custom_additional_role: %shibboleth_user_provider_custom_additional_role% # admin_role_regexp: %shibboleth_user_provider_admin_role_regexp% # user_role_regexp: %shibboleth_user_provider_user_role_regexp% # guest_role_regexp: %shibboleth_user_provider_guest_role_regexp% ...
custom_additional_role: true entitlement_prefix the value |-------------------------| |------| value from federation: urn:geant:niif.hu:hexaa:40:org:customer |--| custom_role_prefix The result: {ROLE_customer}
in app/config/parameters.yml
, (*10)
parameters ... shibboleth_user_provider_entitlement_serverparameter: edupersonentitlement shibboleth_user_provider_entitlement_prefix: urn:oid: shibboleth_user_provider_generate_custom_roles: true ...
in app/config/security.yml
, (*11)
... providers: ... shibboleth: id: shibboleth.user.provider ... ... firewalls: ... secured_area: pattern: ^/ shibboleth: true logout: path: /logout target: https://www.example.com/logged_out success_handler: security.logout.handler.shibboleth ...
When you develop an application you shoud simulate shibboleth authentication anyhow. You can do it in apache config, after enable headers and env modules:, (*12)
Alias /my_app /home/me/my_app/web <Directory /home/me/my_app/web> Options Indexes FollowSymLinks AllowOverride All Require all granted SetEnv Shib-Person-uid myuid SetEnv Shib-EduPersonEntitlement urn:oid:whatever RequestHeader append Shib-Identity-Provider "fakeIdPId" RequestHeader append eppn "myeppn" </Directory>
General UserProvider bundle for shibboleth bundle
MIT
authorization bundle shibboleth userprovider