1000 search results

Testing a Form Submit

…use statement. Do the same for DinosaurFactory. Ok, it's happy! Sure, the code is lacking the normal security and safeguards we expect when using Symfony's form system... but it's only a dinosaur park people! We do, however, have the success flash message!…

5:56
Hot Module Replacement

…Origin set to *: Since our site is served on a different host than our assets... well really a different port... CORS security will prevent some requests from working. This header will allow those requests to be made. Phew! Restart the dev server one more time…

6:43
Micro Symfony via MicroKernelTrait

…from Symfony's SecurityBundle... and we're not using that! If we need it, then you'll need to add it to LittleKernel and configure your security.yml file. For now, remove is_granted(): And try again. It alive... again! That's the MicroKernelTrait in…

9:06
How Symfony Builds the Container

…imports config.yml: And config.yml loads parameters.yml, security.yml and services.yml. Every file in the app/config directory - except the routing files - are being loaded by the container in order to provide services. In other words, all of these files have the…

6:42
Deployment

…there’s no downside here - make sure you have one of these on your server. And on that note, PHP typically gets faster from version to version. So staying on the latest version is good for more than just security and features. Thanks PHPeeps! Ok…

6:51
ManyToOne Doctrine Relationships

… Login as Wayne. Remember, he has ROLE_ADMIN, which also means he has ROLE_EVENT_CREATE because of the role_hierarchy section in security.yml. Now, fill in some basic data and submit it. To see the result, use the query tool to list the…

4:40
Twig

…toolbar, and you may end up loving it even more than the console. It tells us which controller was rendered, the page load time, memory footprint, security info, form details and more. It's added automatically to any page that has a valid HTML structure…

6:27
64 lines | config/packages/security.yaml
security:
// ... lines 2 - 9
enable_authenticator_manager: true
// ... lines 11 - 64
See Code Block in Script
63 lines | config/packages/security.yaml
security:
// ... lines 2 - 20
firewalls:
// ... lines 22 - 24
main:
// ... lines 26 - 27
custom_authenticator:
- App\Security\LoginFormAuthenticator
// ... lines 30 - 63
See Code Block in Script
52 lines | config/packages/security.yaml
security:
// ... lines 2 - 11
firewalls:
// ... lines 13 - 15
main:
// ... lines 17 - 24
access_token:
// ... lines 26 - 52
See Code Block in Script
52 lines | config/packages/security.yaml
security:
// ... lines 2 - 11
firewalls:
// ... lines 13 - 15
main:
// ... lines 17 - 24
access_token:
token_handler: App\Security\ApiTokenHandler
// ... lines 27 - 52
See Code Block in Script
56 lines | config/packages/security.yaml
security:
// ... lines 2 - 37
# 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: ^/admin, roles: ROLE_ADMIN }
# - { path: ^/profile, roles: ROLE_USER }
// ... lines 43 - 56
See Code Block in Script
56 lines | config/packages/security.yaml
security:
// ... lines 2 - 12
role_hierarchy:
ROLE_FULL_USER: [ROLE_USER_EDIT, ROLE_TREASURE_CREATE, ROLE_TREASURE_EDIT]
// ... lines 15 - 56
See Code Block in Script
50 lines | config/packages/security.yaml
security:
// ... lines 2 - 11
firewalls:
// ... lines 13 - 15
main:
// ... lines 17 - 22
logout:
path: app_logout
// ... lines 25 - 50
See Code Block in Script
46 lines | config/packages/security.yaml
security:
// ... lines 2 - 11
firewalls:
// ... lines 13 - 15
main:
// ... lines 17 - 18
json_login:
check_path: app_login
// ... lines 21 - 46
See Code Block in Script
48 lines | config/packages/security.yaml
security:
// ... lines 2 - 11
firewalls:
// ... lines 13 - 15
main:
// ... lines 17 - 18
json_login:
check_path: app_login
username_path: email
password_path: password
// ... lines 23 - 48
See Code Block in Script
48 lines | config/packages/security.yaml
security:
// ... lines 2 - 4
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
providers:
# used to reload user from session & other features (e.g. switch_user)
app_user_provider:
entity:
class: App\Entity\User
property: email
// ... lines 12 - 48
See Code Block in Script
71 lines | config/packages/security.yaml
security:
// ... lines 2 - 20
firewalls:
// ... lines 22 - 24
main:
// ... lines 26 - 49
two_factor:
auth_form_path: 2fa_login
check_path: 2fa_login_check
// ... lines 53 - 71
See Code Block in Script
71 lines | config/packages/security.yaml
security:
// ... lines 2 - 61
access_control:
# This makes the logout route accessible during two-factor authentication. Allows the user to
# cancel two-factor authentication, if they need to.
- { path: ^/logout, role: PUBLIC_ACCESS }
# This ensures that the form can only be accessed when two-factor authentication is in progress.
- { path: ^/2fa, role: IS_AUTHENTICATED_2FA_IN_PROGRESS }
- { path: ^/admin/login, roles: PUBLIC_ACCESS }
- { path: ^/admin, roles: ROLE_ADMIN }
# - { path: ^/profile, roles: ROLE_USER }
See Code Block in Script
71 lines | config/packages/security.yaml
security:
// ... lines 2 - 61
access_control:
// ... lines 63 - 65
# This ensures that the form can only be accessed when two-factor authentication is in progress.
- { path: ^/2fa, role: IS_AUTHENTICATED_2FA_IN_PROGRESS }
// ... lines 68 - 71
See Code Block in Script