Package: dj-sso-client
dj-sso-clientis the a Django application works as SSO client side ofdj-sso-server(https://github.com/feifangit/dj-sso-server)Installationpip installdj-sso-clientAdd to your projectModify following settings insettings.pyof your projectAUTHENTICATION_BACKENDS, adddjssoclient.authbackend.SSOAuthBackendas the backendsAUTH_USER_MODEL, setdjssoclient.SSOUseras user modelAUTHENTICATION_BACKENDS=('djssoclient.authbackend.SSOAuthBackend',)AUTH_USER_MODEL='djssoclient.SSOUser'Add followingdj-sso-clientsettings base on your demandSSO_API_AUTH_SETTING: set API key, SEC key and remote SSO provider URL. This setting is used by underneathdj-api-authmodule to proejct API accessing.SSO_API_AUTH_SETTING={"apikey":"f4a05287","seckey":"6a4eeaea54d54f51af703e79c6096d51","url":"https://dj-sso-sample.herokuapp.com",}SSO_REMOTE_URL_PREFIX(optional): SSO path in remote SSO provider. default/sso/SSO_USER_STORAGE``(optional):SSOUser storage solution, there are 2 storage backends in``dj-sso-clientalready. default: SSOUserDBStoragedjssoclient.userstorage.SSOUserDBStorage: store user data in databasedjssoclient.userstorage.SSOUserCacheStorage: store user data in cache. You will get better performance.SSO_SETTING_CACHE(optional): if you selectedSSOUserCacheStorageas your user storage backend, and you have more than one cache insettings.py, you can pick up the cache name here. default:defaultAttention:SSOUserCacheStorageThe defaultdjango.core.cache.backends.locmem.LocMemCachestores data per process. In multi-process production environment (gunicorn on multi-core server), it may cause problem while usingSSOUserCacheStorageas your user storage engine.Please use dedicate cache system (Memcached or Redis) as cache backend to avoid this problem.SSOUserSSOUseris the user model to store user data. It can be used as database model class if you selectedSSOUserDBStorageto be your user storage engine.classSSOUser(AbstractBaseUser):username=models.CharField(unique=True,max_length=50)extras=models.TextField(default="{}")...extra user attributes: attributes not exists in theSSOUserclass. (attributes exceptusername,password,last_loginetc.)All extra user attributes can be access  bygetattrmethod or.operator. And they are stored in class memberextrasin JSON format.Get your hands dirtyWe already have a SSO provider (dj-sso-server) application running on Heroku:http://dj-sso-sample.herokuapp.com/. Run the example application in folderexample/ssoclient/locally.The API key using in the example application is binding withlocalhost:8000, so make sure you’re accessing local application bylocalhost:8000rather than the127.0.0.1:8000.fresh loginmake sure you’re not logged in onhttp://dj-sso-sample.herokuapp.com/, you should seeplease log in with ...clicksso loginon local application, you will be redirected tohttp://dj-sso-sample.herokuapp.com/sso/….you will see user information after be redirected to local application.onhttp://dj-sso-sample.herokuapp.com/, your status is still not logged-inlogin with existing logged accountlog in with user nameuser1and password123onhttp://dj-sso-sample.herokuapp.com/clicksso loginon local application, you will be redirected tohttp://dj-sso-sample.herokuapp.com/sso/…., but you will see a different login page with fresh login.selectcontinue with current user? user1you will be logged in asuser1at local applicationswitch accountif you selectswitch accountand login withuser2/456from step 3 in previous sampleyou will be logged in asuser2at local applicationyour login status onhttp://dj-sso-sample.herokuapp.com/willNOTbe changed (still logged in asuser1)TODOexample: work as an extra auth method