Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Base lexicale BaLex
Manage
Activity
Members
Labels
Plan
Issues
18
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lex gaMe
Base lexicale BaLex
Commits
e2c1646f
Commit
e2c1646f
authored
2 years ago
by
Pierre Fleutot
Browse files
Options
Downloads
Patches
Plain Diff
Debug demo OAuth2
parent
33dc2b23
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
config/packages/security.yaml
+25
-13
25 additions, 13 deletions
config/packages/security.yaml
src/Controller/IndexController.php
+1
-10
1 addition, 10 deletions
src/Controller/IndexController.php
with
26 additions
and
23 deletions
config/packages/security.yaml
+
25
−
13
View file @
e2c1646f
security
:
enable_authenticator_manager
:
true
role_hierarchy
:
ROLE_ADMIN
:
ROLE_USER
ROLE_SUPER_ADMIN
:
ROLE_ADMIN
# https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords
password_hashers
:
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface
:
'
auto'
...
...
@@ -9,26 +12,35 @@ security:
app_user_provider
:
entity
:
class
:
App\Entity\User
property
:
email
firewalls
:
api_token
:
pattern
:
^/api/token$
security
:
false
api
:
pattern
:
^/api
security
:
true
stateless
:
true
oauth2
:
true
secured_area
:
# ...
form_login
:
# ...
enable_csrf
:
true
dev
:
pattern
:
^/(_(profiler|wdt)|css|images|js)/
security
:
false
main
:
# login_throttling:
# max_attempts: 30
# interval: '5 minutes'
lazy
:
true
provider
:
app_user_provider
form_login
:
login_path
:
app_login
check_path
:
app_login
enable_csrf
:
true
default_target_path
:
app_index
use_referer
:
true
logout
:
path
:
app_logout
target
:
app_index
# activate different ways to authenticate
# https://symfony.com/doc/current/security.html#the-firewall
...
...
@@ -38,12 +50,12 @@ security:
# 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
:
^/authorize
,
roles
:
PUBLIC_ACCESS
}
-
{
path
:
^/login
,
role
:
PUBLIC_ACCESS
}
-
{
path
:
^/token
,
role
:
PUBLIC_ACCESS
}
-
{
path
:
^/.well-known
,
roles
:
PUBLIC_ACCESS
}
-
{
path
:
^/api
/test
,
role
:
ROLE_OAUTH2_EMAIL
}
-
{
path
:
^/
,
role
:
ROLE_USER
}
-
{
path
:
^/authorize
,
roles
:
PUBLIC_ACCESS
}
-
{
path
:
^/login
,
role
:
PUBLIC_ACCESS
}
-
{
path
:
^/token
,
role
:
PUBLIC_ACCESS
}
-
{
path
:
^/.well-known
,
roles
:
PUBLIC_ACCESS
}
-
{
path
:
^/api
,
role
:
ROLE_OAUTH2_EMAIL
}
-
{
path
:
^/
,
role
:
ROLE_USER
}
when@test
:
security
:
...
...
@@ -56,4 +68,4 @@ when@test:
algorithm
:
auto
cost
:
4
# Lowest possible value for bcrypt
time_cost
:
3
# Lowest possible value for argon
memory_cost
:
10
# Lowest possible value for argon
memory_cost
:
10
# Lowest possible value for argon
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/Controller/IndexController.php
+
1
−
10
View file @
e2c1646f
...
...
@@ -9,17 +9,8 @@ use Symfony\Component\Routing\Annotation\Route;
class
IndexController
extends
AbstractController
{
// /**
// * @Route("/", name="app_index")
// */
// public function index(): Response
// {
// return $this->render('index/index.html.twig', [
// 'controller_name' => 'IndexController',
// ]);
// }
/**
* @Route("/
authorize
", name="a
uthorize
")
* @Route("/", name="a
pp_index
")
*/
public
function
authorize
():
Response
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment