2

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.

Kishor Pawar
  • 3,386
  • 3
  • 28
  • 61
  • 4
    I will have to solve a similar issue: using OpenID Connect with allauth. I think you are on the wrong path since OpenID and OpenID connect are two different things. If you want to find an example of using OpenID connect you should look to the "Google authentication" which is de-facto an OpenID connect implementation called with another name. – PaoloC Nov 26 '19 at 22:44

0 Answers0