使用social-auth-app-django,我将设置设置如下:
INSTALLED_APPS = [
...
'social_django.middleware.SocialAuthExceptionMiddleware',
...]
TEMPLATES = [{
...
'OPTIONS': {
'context_processors': [
...
'social_django.context_processors.backends',
'social_django.context_processors.login_redirect',
....
}]
MIDDLEWARE_CLASSES = [
'social_django.middleware.SocialAuthExceptionMiddleware',
]
AUTHENTICATION_BACKENDS = (
'social_core.backends.linkedin.LinkedinOAuth2',
'django.contrib.auth.backends.ModelBackend',
)
回调/重定向网址是
http://localhost:8000/auth/linkedin/callback
如linkedIn开发人员所说,但它不起作用,也不安全。它必须安全吗?