gepur-it / ldap-bundle
Authorisation bundle fot gepur apps
Installs: 10 098
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 1
Type:symfony-bundle
Requires
- php: >=7.4
- ext-json: *
- alcaeus/mongo-php-adapter: >=1.1
- doctrine/doctrine-bundle: >=1.6
- doctrine/mongodb-odm-bundle: >=3.5
- doctrine/orm: >=2.5
- gepur-it/action-logger-bundle: ^5.0
- gepur-it/user: ^4.3|^5.0
- symfony/ldap: ^4.3|^5.0
- symfony/security-bundle: ^5.0
This package is auto-updated.
Last update: 2024-10-28 15:13:18 UTC
README
Authorisation bundle fot gepur apps
Fix security.yaml:
add provider to providers section in security.yaml
security:
...
providers:
gepur_ldap:
id: GepurIt\LdapBundle\Contracts\ErpUserProviderInterface
add api key and ldap authenticators:
security:
...
firewalls:
...
main:
guard:
authenticators:
- GepurIt\LdapBundle\Guard\ApiKeyAuthenticator
- GepurIt\LdapBundle\Guard\LdapAuthenticator
entry_point: GepurIt\LdapBundle\Guard\ApiKeyAuthenticator
add logout handler (to clear api key):
security:
...
firewalls:
...
main:
...
logout:
path: logout
target: /login
invalidate_session: true
success_handler: GepurIt\LdapBundle\Logout\LogoutSuccessHandler
handlers: [GepurIt\LdapBundle\Logout\LogoutHandler]
full added configs:
security:
...
providers:
gepur_ldap:
id: GepurIt\LdapBundle\Contracts\ErpUserProviderInterface
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
pattern: ^/
stateless: true
anonymous: ~
logout:
path: logout
target: /login
invalidate_session: true
success_handler: GepurIt\LdapBundle\Logout\LogoutSuccessHandler
handlers: [GepurIt\LdapBundle\Logout\LogoutHandler]
guard:
authenticators:
- GepurIt\LdapBundle\Guard\ApiKeyAuthenticator
- GepurIt\LdapBundle\Guard\LdapAuthenticator
entry_point: GepurIt\LdapBundle\Guard\ApiKeyAuthenticator