mink67 / security_bundle
1.0.8
2022-08-22 13:26 UTC
Requires
- league/oauth2-client: ^2.6
- mink67/openid_connect: ^1.0.0
- symfony/config: 5.4.*
- symfony/contracts: ^2.4
- symfony/dependency-injection: 5.4.*
- symfony/http-client: 5.4.*
- symfony/http-foundation: 5.4.*
- symfony/http-kernel: 5.4.*
- symfony/security-bundle: 5.4.*
README
Add the config file
-
Create file
mink67_security.yaml
inconfig/packages
directory -
Add the following content in the file :
mink67_security: jwk_url: "http://localhost:8081/auth/realms/RNA/protocol/openid-connect/certs" host: "http://localhost:8081" keycloak_realm: "realm" path_token: "auth/realms/master/protocol/openid-connect/token" keycloak_user_name: "admin" keycloak_pw: "admin" keycloak_client_secret: "xxx-xxx-xxx" keycloak_client_id: "admin-cli"
Add package
$ composer require mink67/security_bundle
Add new provider and new firewalls in file security.yaml
in config/packages
directory
```
http://localhost:8081/auth/realms/pao/protocol/openid-connect/certs
security:
...
providers:
...
oauth:
id: Mink67\Security\User\OAuthUserProvider
...
...
...
firewalls:
...
api:
pattern: ^/api/
provider: oauth
stateless: true
...
...
```