beu/oauth2-trackmania
最新稳定版本:1.1
Composer 安装命令:
composer require beu/oauth2-trackmania
包简介
A TrackMania 2020 provider for league/oauth2-client
README 文档
README
How to install it
Add this in your composer.json file:
"repositories": [
{
"url": "https://git.virtit.fr/beu/oauth2-trackmania.git",
"type": "git"
}
],
change the value of minimum-stability to dev in it.
then launch the command:
composer require beu/oauth2-trackmania
How to configure it
Install the security bundle:
composer require symfony/security-bundle
Then create the User Entity
php bin/console make:user
Note that you have to answer no to the question Does this app need to hash/check user passwords?
Then, you could copy the files TrackMania.php in src/Controller/OAuth2/, TrackManiaAuthenticator.php in src/Security/ and TrackManiaAuthenticatorSubscriber.php in src/Event/.
Then change the config/packages/knpu_oauth2_client.yaml file like this:
knpu_oauth2_client:
clients:
TrackMania:
type: generic
provider_class: \Beu\TrackMania\OAuth2\Client\Provider\TrackManiaProvider
client_id: '%env(OAUTH2_TRACKMANIA_CLIENTID)%'
client_secret: '%env(OAUTH2_TRACKMANIA_SECRET)%'
redirect_route: connect_trackmania_check
redirect_params: {}
and in the config/packages/security.yaml file, in the security -> firewalls -> main part:
remove the property provider and add these lines:
custom_authenticators:
- App\Security\TrackManiaAuthenticator
logout:
path: app_logout
After that, you will need to get the Client ID and the Secret on https://api.trackmania.com/ and add them in your .env file like this:
OAUTH2_TRACKMANIA_CLIENTID=XXXXXXXXXXXXXXXXXXX
OAUTH2_TRACKMANIA_SECRET=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
统计信息
- 总下载量: 27
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2024-07-31