我正在使用Google G Suite并创建了一个应用程序,该应用程序通过G Suite SAML管理用户登录.(请参阅https://support.google.com/a/answer/6087519?hl=zh-CN&ref_topic=6304963#)
一切顺利,但是当用户没有登录我们的G Suite帐户并登录自己的Google帐户时,我会遇到问题.
在这种情况下,Google登录页面不会要求用户登录我们的G Suite帐户并直接提供403 - app_not_configured_for_user错误.
所以,这是问题
谢谢.
我将 Gsuite 用作 Saml IDP,以在内部应用上对我组织的用户进行身份验证。
一切正常,除了一点:当我的一个用户仅使用他/她的个人帐户登录时,Google 将失败:
403 错误:app_not_configured_for_user
这是有道理的,因为该应用程序仅供内部用户使用,但我希望能够强制 Google saml 身份验证显示帐户选择器,即使用户已经登录到一个帐户,因为这对于 oauth2 是可能的使用 prompt=select_account。
任何方式与 SAML 具有相同的行为?
[编辑]我实际上设法通过使用实现了我想要的
https://accounts.google.com/AccountChooser/?continue= $SAML_REQUEST$
[编辑 2] 这是在 ruby on rails 中进行适配的代码片段(使用ruby-saml)
配置/初始化程序/saml_override.rb
module OneLogin
module RubySaml
class Authrequest < SamlMessage
GOOGLE_ACCOUNT_CHOOSER_URL = "https://accounts.google.com/AccountChooser?continue="
alias_method :old_create, :create
def create(settings, params = {})
self.old_create(settings, params)
@login_url = GOOGLE_ACCOUNT_CHOOSER_URL + CGI.escape(@login_url)
end
end
end
end
Run Code Online (Sandbox Code Playgroud) saml http-status-code-403 oauth-2.0 google-oauth google-workspace