i have created a Django webapp, and i want to use allauth to create a sso for github.
我已经创建了一个Django Web应用程序,我想使用allauth为GitHub创建一个SSO。
I have set it up, and it works fine. But now all github users can login to my webapp. I want to restrict it only to my github organization. So that all users of my organization can login to the web app and users which are not in the organization cant login.
我已经设置好了,它运行得很好。但现在,所有GitHub用户都可以登录我的网络应用程序。我想将其仅限于我的GitHub组织。以便我的组织的所有用户都可以登录到Web应用程序,而不在组织中的用户不能登录。
Is there any option from allauth to realize this? i have checked the allauth documentation, but i can't find any option for that.
从allauth有没有任何选择来实现这一点?我已经检查了allauth文档,但我找不到任何选项。
Or is there any other way which i can use to realize my requirement?
或者,有没有其他方法可以用来实现我的要求?
更多回答
can you please provide details like settings.py
please?
你能提供像settings.py这样的细节吗?
my settings.py look like this: SOCIALACCOUNT_PROVIDERS = { 'github': { 'APP': { 'client_id': 'xxxx', 'secret': 'xxxxx', 'scope': ['read:user', 'read:email'], } }, }
我的settings.py如下所示:SOCIALACCOUNT_PROVIDERS={‘GitHub’:{‘app’:{‘Client_id’:‘XXXX’,‘Secret’:‘xxxxx’,‘Scope’:[‘Read:User’,‘Read:Email’],}},}
优秀答案推荐
我是一名优秀的程序员,十分优秀!