contao-id / contao-bundle
此插件提供了与contao.id服务的OAuth2身份验证
1.2.0
2024-08-19 10:45 UTC
Requires
- php: ^8.2
- contao/core-bundle: ^5.3
- contao/manager-bundle: ^5.3
- contao/manager-plugin: ^2.3.1
- doctrine/dbal: ^3.7
- hwi/oauth-bundle: 2.1.*
- symfony/config: ^6.4 || ^7.0
- symfony/dependency-injection: ^6.4 || ^7.0
- symfony/http-foundation: ^6.4 || ^7.0
- symfony/http-kernel: ^6.4 || ^7.0
- symfony/security-bundle: ^6.4 || ^7.0
- symfony/security-core: ^6.4 || ^7.0
- twig/twig: ^3.8
Requires (Dev)
README文件
config/security.yaml
contao_backend:
[...]
oauth:
resource_owners:
contao_id: "/contao/login/contao_id"
login_path: /contao/login
default_target_path: /contao
use_forward: false
failure_path: /contao/login
oauth_user_provider:
service: contao_id_contao.security.user_provider
config/packages/hwi_oauth.yaml
hwi_oauth:
firewall_names: [contao_backend]
resource_owners:
contao_id:
type: oauth2
class: HWI\Bundle\OAuthBundle\OAuth\ResourceOwner\OAuth2ResourceOwner
client_id: '%contao_id_identifier%'
client_secret: '%contao_id_secret%'
access_token_url: 'https://auth.contao.id/auth/token'
authorization_url: 'https://auth.contao.id/auth/authorize'
infos_url: 'https://auth.contao.id/api/auth/info/%contao_id_identifier%'
scope: 'read'
user_response_class: HWI\Bundle\OAuthBundle\OAuth\Response\PathUserResponse
paths:
identifier: id
config/bundles.php
HWI\Bundle\OAuthBundle\HWIOAuthBundle::class => ['all' => true],
ContaoId\ContaoBundle\ContaoIdContaoBundle::class => ['all' => true],
.env.local
# Contao ID
CONTAO_ID_IDENTIFIER=1234
CONTAO_ID_SECRET=12345678
config/routes.yaml
[...]
ContaoIdContaoBundle:
resource: "@ContaoIdContaoBundle/config/routes.yaml"