Repository navigation
Expand file tree
/
Copy pathsecurity.yaml
More file actions
85 lines (78 loc) · 3.24 KB
/
Copy pathsecurity.yaml
File metadata and controls
85 lines (78 loc) · 3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
security:
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
providers:
app_user_provider:
id: 'App\Security\Core\UserProvider'
firewalls:
dev:
# Ensure dev tools and static assets are always allowed
pattern: ^/(_profiler|_wdt|assets|build)/
security: false
# RFC 9728 metadata must stay public: a client holding an invalid token still has to discover the authorization server
oauth_metadata:
pattern: ^/\.well-known/oauth-protected-resource
security: false
# MCP clients must use access tokens issued for the MCP server (audience), see McpAuthorizationListener
mcp:
pattern: ^/mcp
provider: app_user_provider
stateless: true
main:
lazy: true
provider: app_user_provider
stateless: true
# Activate different ways to authenticate
# https://symfony.com/doc/current/security.html#the-firewall
# 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* matching rule is applied
access_control:
- { path: ^/profile, roles: IS_AUTHENTICATED_FULLY }
when@prod: &prod
security:
firewalls:
mcp:
access_token:
token_handler:
oidc:
claim: 'email'
audience: '%env(OIDC_MCP_AUD)%'
issuers: [ '%env(OIDC_SERVER_URL)%' ]
algorithms: [ 'RS256' ]
discovery:
base_uri: '%env(OIDC_SERVER_URL_INTERNAL)%/'
cache:
id: 'cache.app'
main:
access_token:
token_handler: App\Security\Http\AccessToken\Oidc\OidcDiscoveryTokenHandler
# todo support Discovery in Symfony
# oidc:
# claim: 'email'
# base_uri: '%env(OIDC_SERVER_URL)%'
# audience: '%env(OIDC_AUD)%'
# cache: '@cache.app' # default
# cache_ttl: 600 # default
when@dev: *prod
when@test:
security:
firewalls:
mcp:
access_token:
token_handler:
oidc:
claim: 'email'
audience: '%env(OIDC_MCP_AUD)%'
issuers: [ '%env(OIDC_SERVER_URL)%' ]
algorithm: 'ES256'
keyset: '{"keys":[%env(OIDC_JWK)%]}'
main:
access_token:
token_handler:
oidc:
claim: 'email'
audience: '%env(OIDC_AUD)%'
issuers: [ '%env(OIDC_SERVER_URL)%' ]
algorithm: 'ES256'
keyset: '{"keys":[%env(OIDC_JWK)%]}'