Add Suite-8 user authentication

This commit is contained in:
Dillon-Brown 2020-02-03 07:18:15 +00:00
parent ca0e00dfd1
commit 9bff8530c6
25 changed files with 845 additions and 100 deletions

View file

@ -12,4 +12,5 @@ return [
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true],
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
];

View file

@ -0,0 +1,6 @@
web_profiler:
toolbar: true
intercept_redirects: false
framework:
profiler: { only_exceptions: false }

View file

@ -13,6 +13,6 @@ doctrine:
App:
is_bundle: false
type: annotation
dir: '%kernel.project_dir%/core/modules'
prefix: 'SuiteCRM\Core\Modules\'
dir: '%kernel.project_dir%/core/src'
prefix: 'App\Entity\'
alias: App

View file

@ -1,10 +1,31 @@
security:
encoders:
App\Entity\User:
algorithm: auto
providers:
in_memory: { memory: null }
app_user_provider:
entity:
class: App\Entity\User
property: username
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
anonymous: lazy
guard:
authenticators:
- App\Security\LoginFormAuthenticator
form_login:
login_path: app_login
check_path: app_login
logout:
path: app_logout
# Note: Only the *first* access control that matches will be used
access_control:
- { path: ^/login$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/, roles: IS_AUTHENTICATED_FULLY }

View file

@ -0,0 +1,6 @@
web_profiler:
toolbar: false
intercept_redirects: false
framework:
profiler: { collect: false }

View file

@ -0,0 +1,7 @@
web_profiler_wdt:
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
prefix: /_wdt
web_profiler_profiler:
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
prefix: /_profiler

View file

@ -23,8 +23,8 @@ services:
# controllers are imported separately to make sure services can be injected
# as action arguments even if you don't extend any base controller class
SuiteCRM\Core\Modules\:
resource: '../core/modules/'
App\Controller\:
resource: '../core/src/Controller/*'
tags: ['controller.service_arguments']
# add more service definitions when explicit configuration is needed