| 1 |
Weixin |
| 2 |
------ |
| 3 |
|
| 4 |
The Weixin OAuth2 documentation: |
| 5 |
|
| 6 |
https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1419316505&token=&lang=zh_CN |
| 7 |
|
| 8 |
Weixin supports two kinds of oauth2 authorization, one for open platform and |
| 9 |
one for media platform, AUTHORIZE_URL is the only difference between them, you |
| 10 |
can specify ``AUTHORIZE_URL`` in setting, If no ``AUTHORIZE_URL`` value is set |
| 11 |
will support open platform by default, which value is |
| 12 |
``https://open.weixin.qq.com/connect/qrconnect``. |
| 13 |
|
| 14 |
You can optionally specify additional scope to use. If no ``SCOPE`` value |
| 15 |
is set, will use ``snsapi_login`` by default(for Open Platform Account, need |
| 16 |
registration). Other ``SCOPE`` options are: snsapi_base, snsapi_userinfo. |
| 17 |
|
| 18 |
.. code-block:: python |
| 19 |
|
| 20 |
SOCIALACCOUNT_PROVIDERS = { |
| 21 |
'weixin': { |
| 22 |
'AUTHORIZE_URL': 'https://open.weixin.qq.com/connect/oauth2/authorize', # for media platform |
| 23 |
'SCOPE': ['snsapi_base'], |
| 24 |
} |
| 25 |
} |