简体   繁体   中英

Proper way to implement python-social-auth with Django and Steam backend

I want to use Python Social Auth to authenticate my users using the Steam OpenId back end. I've followed the Django Configuration steps . But, at this point I don't know the next steps.

Theoretically, my application is ready to use the OpenId provider but I can't find anything in the documentation that tells me how to use the provider. What do I need to do to make use of this functionality?

Probably a bit late for a useful answer, but just in case... this is a bare bones procedure I just cobbled together, but should get you started. Assuming you got the Django-specific parts done (including syncdb ), what you need now is to complete the generic Social Auth and Steam configuration...

You need a Steam API key (get it here )

In settings.py , add the key:

SOCIAL_AUTH_STEAM_API_KEY = '...'

And add the backend:

AUTHENTICATION_BACKENDS = (
    'social.backends.steam.SteamOpenId',
    #others, if you want them...
)

In urls.py , add the social URLs:

urlpatterns = patterns('',
    url('', include('social.apps.django_app.urls', namespace='social')),
)

Now create your login link using /login/steam?next=/ , where next is where the user should land post-login. For the login link, make sure you follow the guidance on the Steam dev community page and use an appropriate image. And note that the default pipeline will auto-create the Django user.

Like I said, bare bones (I didn't do anything with the template context processors), but hopefully it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM