summaryrefslogtreecommitdiffstats
path: root/admin/WebConsole3/backend/config/packages/security.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'admin/WebConsole3/backend/config/packages/security.yaml')
-rw-r--r--admin/WebConsole3/backend/config/packages/security.yaml59
1 files changed, 59 insertions, 0 deletions
diff --git a/admin/WebConsole3/backend/config/packages/security.yaml b/admin/WebConsole3/backend/config/packages/security.yaml
new file mode 100644
index 00000000..2e233ba2
--- /dev/null
+++ b/admin/WebConsole3/backend/config/packages/security.yaml
@@ -0,0 +1,59 @@
+security:
+ encoders:
+ Symfony\Component\Security\Core\User\User: plaintext
+ FOS\UserBundle\Model\UserInterface: sha512 #{ algorithm: 'bcrypt', cost: 10 }
+
+ role_hierarchy:
+ ROLE_ADMIN: [ROLE_USER]
+ ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
+
+ providers:
+ opengnsys_userbundle:
+ id: fos_user.user_provider.username
+ firewalls:
+ ## AUTH 2.0 ##
+ oauth_token:
+ pattern: ^/oauth/v2/token
+ security: false
+
+ ## API - WEB SERVICE - REST ##
+ api_private:
+ pattern: ^/api/private
+ fos_oauth: true
+ stateless: true
+ anonymous: false
+ api:
+ pattern: ^/api
+ stateless: true
+ anonymous: true
+ ## MAIN --> WEB ./ ##
+ dev:
+ pattern: ^/(_(profiler|wdt)|css|images|js)/
+ security: false
+ main:
+ pattern: .*
+ context: user
+ form_login:
+ provider: opengnsys_userbundle
+ login_path: /login
+ use_forward: false
+ check_path: /login_check
+ failure_path: null
+ logout: true
+ #path: fos_user_security_logout
+ #target: /
+ anonymous: true
+ remember_me:
+ secret: "%secret%"
+ lifetime: 31536000 # 365 days in seconds
+ path: /
+ name: REMEMBERME_OG_MAIN
+ access_control:
+ # Auth login
+ - { path: ^/oauth/v2/auth_login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
+ # Secured part of the site
+ - { path: ^/.*, role: IS_AUTHENTICATED_ANONYMOUSLY } #ROLE_ADMIN
+ # Securet part of Api
+ - { path: ^/api/private, roles: [ IS_AUTHENTICATED_FULLY ] }
+
+