使用Django REST框架的SAML SSO身份验证 [英] SAML SSO Authentication with Django REST Framework

查看:166
本文介绍了使用Django REST框架的SAML SSO身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发AngularJS前端和Django REST后端.我过去一直使用 django-rest-auth 来验证我之间的连接两者,但是我现在必须使用SAML集成SSO身份验证.

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.

我环顾四周,决定使用 python3-saml ,但是任何文档和用例示例(针对此软件包以及其他任何示例)适用于纯Django应用程序.

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.

我一直基于OneLogin的 django/flask指南,我尝试制作一个定制的中间件,它将捕获我的请求,但OneLogin提供的重定向的实现不适用于REST调用(显然).我还看到一些人使用Django的AUTHENTICATION_BACKENDS设置,我想知道这是否是我正在寻找的更多内容.

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.

谢谢您的帮助.

推荐答案

因此,在进行了更多研究和试验之后,我选择了 django_saml2_auth .它是即插即用的,但是我不得不删除令牌身份验证,并使用基本身份验证和会话身份验证.

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.

这篇关于使用Django REST框架的SAML SSO身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆