0

使用django-allauth通过Stripe Connect对用户进行身份验证。似乎连接条带化和允许登录,但是当回到我的网站,它呈现的allauth错误模板,说:django-allauth重定向url使用Stripe OAuth说“登录失败”

An error occurred while attempting to login via your social network account. 

任何想法对我做了什么错在这里?

这是我所做的。

settings.py

INSTALLED_APPS = [ 
        ... 
        'allauth', 
        'allauth.account', 
        'allauth.socialaccount', 
        'allauth.socialaccount.providers.stripe', 
        ... 
        ] 

AUTHENTICATION_BACKENDS = [ 
          ... 
          'allauth.account.auth_backends.AuthenticationBackend', 
          ... 
          ] 

SITE_ID = 1 

urls.py

urlpatterns = [ 
       ... 
       url(r'^accounts/', include('allauth.urls')), 
       ... 
       ] 

的login.html

{% if user and not.is_anonymous %} 
    <h2>Hello, {{ user.get_full_name }}.</h2> 

{% else %} 
    <p><a href="{% provider_login_url 'stripe' %}" class="btn btn-default">Stripe</a></p> 

{% endif %} 

条纹连接

Website URL: https://127.0.0.1:8000 

Redirect_URIs: http://127.0.0.1:8000/accounts/stripe/login/callback/ 

在django管理员中设置社交应用程序,如下所示:

Social Applications = http://127.0.0.1:8000/ 
+0

也许你错过了一些与standelone连接。再次查看https://stripe.com/docs/connect/standalone-accounts – rakwen

回答

0

ooops。我在allauth管理社交应用程序字段中使用Client_ID而不是来自Stripe Connect仪表板的API密钥。