Skip to content

Commit 51930cf

Browse files
committed
Remove unnecessary files
1 parent d875775 commit 51930cf

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
namespace Axium\Identity\Recipe;
4+
5+
use Symfony\Component\Yaml\Yaml;
6+
7+
class SecurityConfigurator
8+
{
9+
public function configure(array $options): void
10+
{
11+
$file = 'config/packages/security.yaml';
12+
13+
if (!file_exists($file)) {
14+
return;
15+
}
16+
17+
$config = Yaml::parseFile($file);
18+
19+
$security = $config['security'] ?? [];
20+
21+
// Ajouter le provider
22+
$security['providers']['axium_identity'] = [
23+
'id' => 'Axium\\Identity\\Security\\IdentityUserProvider'
24+
];
25+
26+
// Ajouter firewall
27+
$security['firewalls']['main']['custom_authenticator'][] =
28+
'Axium\\Identity\\Security\\IdentityAuthenticator';
29+
30+
// Ajouter access_control
31+
$security['access_control'][] = [
32+
'path' => '^/api/oauth/token',
33+
'roles' => 'PUBLIC_ACCESS'
34+
];
35+
36+
$config['security'] = $security;
37+
38+
file_put_contents(
39+
$file,
40+
Yaml::dump($config, 10)
41+
);
42+
}
43+
}

axium/identity/1.0/manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
"copy-from-recipe": {
88
"config/": "%CONFIG_DIR%/"
99
},
10+
"configurators": [
11+
"Axium\\Identity\\Recipe\\SecurityConfigurator"
12+
],
1013
"env": {
1114
"AXIUM_IDENTITY_URL": "https://identity.example.com",
1215
"AXIUM_CLIENT_ID": "your-client-id",

0 commit comments

Comments
 (0)