superadmin / auth-bundle
SuperAdmin Bundle using ApiPlatform and JWT
Installs: 2 398
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=7.1
- ext-ctype: *
- ext-iconv: *
- ext-json: *
- doctrine/doctrine-bundle: ^2.2
- lexik/jwt-authentication-bundle: ^2.10
- symfony/framework-bundle: ^3.4|^4.0|^5.0
- symfony/security-bundle: ^3.4|^4.0|^5.0
Requires (Dev)
- symfony/browser-kit: ^3.4|^4.0|^5.0
- symfony/console: ^3.4|^4.0|^5.0
- symfony/dom-crawler: ^3.4|^4.0|^5.0
- symfony/phpunit-bridge: ^3.4|^4.0|^5.0
- symfony/var-dumper: ^3.4|^4.0|^5.0
- symfony/yaml: ^3.4|^4.0|^5.0
Conflicts
- dev-main
- v1.4.1
- v1.3.22
- v1.3.21
- v1.3.19
- v1.3.18
- 1.3.17
- v1.3.16
- v1.3.15
- v1.3.14
- v1.3.13
- v1.3.12
- v1.3.11
- v1.3.10
- v1.3.9
- v1.3.8
- v1.3.7
- v1.3.6
- v1.3.5
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.15
- v1.2.14
- v1.2.13
- v1.2.12
- v1.2.11
- v1.2.10
- v1.2.9
- v1.2.8
- v1.2.7
- v1.2.6
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.2
- v1.0.1
- v1.0.0
This package is auto-updated.
Last update: 2024-04-14 17:20:59 UTC
README
This package provides easy Symfony integration with the SuperAdmin API.
You can either start your own SuperAdmin Server or use the managed service for free.
Installation
As of version ~1.0
of this bundle, there is only provided the implementation classes,
the configuration and dependency management must be done by the user (documented here).
In further versions it will go automatically at bundle installation.
Dependencies
composer require lexik/jwt-authentication-bundle
Install via composer
composer require superadmin/auth-bundle ~1.0
Configuration
After installation, you must add the following settings to your config files
# File config/packages/security.yaml security: access_decision_manager: strategy: unanimous allow_if_all_abstain: false # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers providers: jwt: lexik_jwt: class: SuperAdmin\Bundle\Security\User firewalls: dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false main: pattern: ^/ stateless: true anonymous: true provider: jwt guard: authenticators: - lexik_jwt_authentication.jwt_token_authenticator - SuperAdmin\Bundle\Security\Authenticator\ApiKeyAuthenticator entry_point: lexik_jwt_authentication.jwt_token_authenticator # activate different ways to authenticate # https://symfony.com/doc/current/security.html#firewalls-authentication # https://symfony.com/doc/current/security/impersonating_user.html # switch_user: true # Easy way to control access for large sections of your site # Note: Only the *first* access control that matches will be used access_control: - { path: ^/docs, roles: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/public, roles: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/sadmin, roles: ROLE_SUPER_ADMIN } - { path: ^/admin, roles: ROLE_ADMIN } - { path: ^/, roles: ROLE_USER }
# File config/services.yaml services: # here your original configurations # ... SuperAdmin\Bundle\Security\Authenticator\ApiKeyAuthenticator: arguments: [ '@doctrine.orm.entity_manager'] SuperAdmin\Bundle\Security\Serializer\ContextBuilder: decorates: 'api_platform.serializer.context_builder' arguments: [ '@SuperAdmin\Bundle\Security\Serializer\ContextBuilder.inner' ] autoconfigure: false SuperAdmin\Bundle\EventListener\OwnedFilterConfigurator: tags: - { name: kernel.event_listener, event: kernel.request, priority: 5 } # Autoconfiguration must be disabled to set a custom priority autoconfigure: false
# File config/packages/doctrine.yaml doctrine: dbal: url: '%env(resolve:DATABASE_URL)%' # IMPORTANT: You MUST configure your server version, # either here or in the DATABASE_URL env var (see .env file) #server_version: '5.7' orm: auto_generate_proxy_classes: true naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware auto_mapping: true mappings: App: is_bundle: false type: annotation dir: '%kernel.project_dir%/src/Entity' prefix: 'App\Entity' alias: App filters: owned_filter: class: SuperAdmin\Bundle\Filter\OwnedFilter