针对 SAML IDP 对移动用户进行身份验证 [英] Authenticating mobile users against SAML IDP

查看:62
本文介绍了针对 SAML IDP 对移动用户进行身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找解决方案 - 针对 SAML IDP 对移动应用程序用户进行身份验证,并且有一些基本查询(我是 SAML、OAuth 的新手 :))在这种情况下,流程可能就像移动用户将通过 IDP 进行身份验证,IDP 生成的 SAML 响应被发送到服务提供商(通过移动浏览器 - Webview).然后,服务提供者将创建一个令牌,移动应用程序将使用该令牌进行后续调用.这种理解正确吗?

I am looking for a solution for - authenticating mobile-app users against SAML IDP, and have got some basic queries (I am new to SAML, OAuth :) ) In this scenario, the flow could be like the mobile user will be authenticated by IDP, the SAML response generated by IDP is sent to Service provider (via mobile browser - Webview). The Service provider will then create a token which will be used by the mobile app for subsequent calls. Is this understanding correct ?

此外,移动用户将如何在 IDP 进行身份验证,我的意思是,相应的 IDP 是否应该支持移动应用程序?登录时会在手机上看到 IDP 的登录屏幕吗?

Also, how will the mobile user authenticate at IDP, I mean, should the corresponding IDP should have support for mobile apps? IDP's login screen will be seen on the mobile during login?

在我的应用程序中,目前,移动(Rest API)用户根据其应用程序在数据库中的凭据进行身份验证.但现在桌面应用程序正在整合 SAML 进行身份验证.因此,移动用户需要根据 SAML IDP 进行身份验证.

In my application, currently, mobile (Rest APIs) user is authenticated against its application's credentials in database. But now the desktop app is incorporating SAML for authentication. So mobile users need to be authenticated against SAML IDP.

提前致谢!

推荐答案

是的,你的理解是正确的.为了在移动客户端上使用 SAML IDP,您需要执行与普通客户端相同的过程(AuthnRequest -> SP 和 IDP 之间的响应交换).整个流程可能如下所示:

Yes, your understanding is correct. In order to use SAML IDP with mobile clients you need to go through the same process as on normal clients (AuthnRequest -> Response exchange between SP and IDP). The whole flow can look like this:

  • 您的移动应用程序打开 WebView,访问您的 SP 的公共 URL
  • 您的 SP 通过使用 AuthnRequest 向 SAML IDP 发送重定向,开始使用 IDP 进行身份验证
  • 用户在 IDP 的 UI 内进行身份验证(当它使用移动客户端打开时,它应该能够为移动客户端正确呈现)
  • IDP 通过响应重定向回您的 SP
  • 您的 SP 应用程序处理响应并生成可用于您的 Rest API 的令牌
  • SP 将令牌传递回移动应用程序(例如,使用 WebViewClient + onPageFinished + cookie,或调用 addJavascriptInterface 提供的对象,或您已经使用的任何内容)

与通常使用 IDP 的移动身份验证(例如对 Facebook/Google 使用 OAuth 2)相比,SAML 更为复杂.使用 OAuth 2.0,可以轻松提取授权令牌并使用自定义 URL 方案拦截响应,而无需 Web 部署 (SP) 组件.由于 SAML 不支持类似于 Oauth 中的隐式"流(出于安全原因),并且由于 SAML 响应的处理要复杂得多(由于 XML 签名、XML 加密等),因此这种方法在使用时不可行SAML.

In comparison with the usual mobile authentication with IDPs (such as using OAuth 2 for Facebook/Google), SAML is more complicated. With OAuth 2.0 it's easy to extract the authorization token and intercept response by using a custom URL scheme, without need for a web deployed (SP) component. As SAML doesn't support flow similar to "implicit" in Oauth (for security reasons) and because processing of SAML response is much more complex (due to XML signatures, XML encryption, ...), this approach is not feasible when using SAML.

这篇关于针对 SAML IDP 对移动用户进行身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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