问题
I'm currently working on a AngularJS front-end and Django REST back-end. I've been using django-rest-auth in the past to authenticate my connections between the two, but I now have to integrate a SSO authentication using SAML.
I've looked around and decided to use python3-saml, but any of the documentation and use case examples (for this package and any other) are applied for pure Django applications.
I've been basing myself on OneLogin's django/flask guide and I tried making a custom Middleware that would catch my requests, but the implementation of the redirects provided by OneLogin does not work with REST call (obviously). I've also seen some people using the AUTHENTICATION_BACKENDS Django setting and I'm wondering if it's maybe more what I'm looking for.
Thank you for any help.
回答1:
So after more research and trials, I've gone with django_saml2_auth instead. It's pretty much plug and play, but I had to remove Token authentication and use Basic and Session authentication.
来源:https://stackoverflow.com/questions/46473893/saml-sso-authentication-with-django-rest-framework