WeChat ✔️
Add WeChat OAuth Provider
アプリケーションにWeChat OAuthプロバイダーを追加するには、以下の手順に従ってください:
- WeChat開発者プラットフォームにアクセスし、開発者として登録してください。
- ウェブアプリケーションまたはモバイルアプリケーションが承認された後、App IDとApp Secretを受け取ります。
WeChatプロバイダーは2種類のキーペアを提供しています:
最初のキーペア(
Client ID
、Client Secret
)はWeChat Open Platform (微信开放平台)
用で、PCログインシナリオ用に設計されています。 これにより、PCブラウザにQRコードを表示し、ユーザーがモバイルフォンのWeChatアプリを使用してスキャンし、サインインすることができます。2番目のキーペア(
Client ID 2
、Client Secret 2
)とAccess Token
フィールドはWeChat Media Platform (微信公众平台)
用で、WeChatアプリ内ログインシナリオを想定しています。Access Token
フィールドは、WeChat Media Platform (微信公众平台)
のserver configuration
に入力するToken
です。 WeChatモバイルアプリ内のWeChat組み込みブラウザでユーザーがログインし、WeChat Official Account (微信公众号)
にリダイレクトされてログインすることを可能にします。 WeChatはWeChatアプリの外部、他のモバイルブラウザーやアプリでのログインをサポートしていないことに注意してください。 この制限はWeChatによって課されたものであり、Casdoorによるものではありません。
2番目のキーペア(Client ID 2
、Client Secret 2
)を入力し、Access Token
フィールドを入力してEnable QR code
スイッチを有効にすると、QRコードをスキャンした後、WeChat Media Platform (微信公众平台)
から直接ログインするか、WeChat Open Platform (微信开放平台)
からログインするかを選択できます。もしuse Wechat Open Platform to login
を選択した場合、ユーザーがWeChat公式アカウント(微信公众号)をフォローした後、WeChat Open Platform (微信开放平台)
のQRコードをスキャンしてログインする必要があります。 Casdoorは、ユーザーがWeChatボタンをクリックしてログインする際に、ログインプロセスを進める前にユーザーにWeChat公式アカウント(微信公众号)をフォローするよう求めます。 この機能はPCログインシナリオでのみ利用可能であることに注意することが重要です。なぜなら、モバイルフォン自体ではQRコードをスキャンすることができないからです。 モバイルシナリオで使用される場合(つまり、WeChatモバイルアプリ内のWeChat組み込みブラウザー)、Casdoorは自動的にこのステップをスキップします。
You can choose whether to enable the WeChat QR code login option on the setting page. To do so, add the WeChat provider in your application configuration and add the WeChat option in your signin methods. Once added, the login page will display a "WeChat" tab as a login option, allowing users to log in by scanning the QR code.
The QR code login process is as follows:
- On the login page, after selecting the "WeChat" tab, a WeChat QR code will be automatically loaded and displayed.
- The user scans the QR code using the WeChat app and completes the authorization to log in.
- If the QR code expires or needs to be refreshed, the user can click the "Refresh" link below the QR code to obtain a new one.
WeChat Open Platform (微信开放平台)
アカウントとWeChat Media Platform (微信公众平台)
アカウントをWeChat Open Platform (微信开放平台)
内でリンクし、同時に両方のキーセットを設定することをお勧めします。 これにより、CasdoorはPCとモバイルの両方を通じてログインしたWeChatユーザーを同一のユーザーとして認識することができます。
WeChat OAuthの制限により、現在WeChatアプリ以外のサードパーティモバイルアプリやモバイルブラウザでWeChat経由でログインする方法はありません。 モバイルログインは現時点ではWeChatアプリ内で行う必要があります。
詳細については、WeChat Open Platformをご覧ください。
Enable WeChat QR Code Login
You can choose whether to enable the WeChat QR code login option on the setting page. To do so, add the WeChat provider in your application configuration and add the WeChat option in your signin methods. Once added, the login page will display a "WeChat" tab as a login option, allowing users to log in by scanning the QR code.
The QR code login process is as follows:
- On the login page, after selecting the "WeChat" tab, a WeChat QR code will be automatically loaded and displayed.
- The user scans the QR code using the WeChat app and completes the authorization to log in.
- If the QR code expires or needs to be refreshed, the user can click the "Refresh" link below the QR code to obtain a new one.