So I am following this doc. I added the following into my settings.py
SOCIALACCOUNT_PROVIDERS = {
'openid': {
'SERVERS': [
dict(id='okta',
name='Okta',
openid_url='https://dev-292302.okta.com/oauth2/default'),
]
}
}
and the following in my login.html
{% load socialaccount %}
<a href="{% provider_login_url "openid"
openid="https://dev-292302.okta.com/oauth2/default"
next="/success/url/" %}">Okta OpenID</a>
I seem to have issues with "openid"
key above. If I add that into anchor above it gives me KeyError
. If I remove it I get following.
VariableDoesNotExist at /login/
Failed lookup for key [openid='https://dev-292302] in u"[{'False': False, 'None': None, 'True': True}, {}, {}, {'site_name': u'example Server', 'site': <Site: example.com>, 'form': <AuthenticationForm bound=False, valid=False, fields=(username;password)>, 'next': u'/'}]" .
another thing is that, which I think could be related, doc says to add id in extra_data
field of socialaccount. So should I create a social account first?
Attributes are in form (id, name, required) where id is key in extra_data field of socialaccount, name is identifier of requested attribute and required specifies whether attribute is required.