我正在使用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错误.
所以,这是问题
谢谢.
问题:Google 可以通过在其网页上使用 Google 身份验证集成的网站跟踪我。此外,此弹出窗口会中断我在没有 Google 的情况下登录的用户体验。我该如何有效地摆脱这些呢?
我的应用在Google Compute Engine上运行.Nginx用作代理服务器.Nginx配置为使用SSL.以下是/ etc/nginx/sites-available/default的内容:
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name mywebapp.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
include snippets/ssl-mywebapp.com.conf;
include snippets/ssl-params.conf;
root /home/me/MyWebApp/wwwroot;
location /.well-known/ {
}
location / {
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
Run Code Online (Sandbox Code Playgroud)
在Startup.cs我有:
app.UseGoogleAuthentication(new GoogleOptions()
{
ClientId = Configuration["Authentication:Google:ClientId"],
ClientSecret = Configuration["Authentication:Google:ClientSecret"],
});
Run Code Online (Sandbox Code Playgroud)
现在,在Google Cloud Platform中,我需要指定授权重定向URI.如果我输入以下内容,我的网络应用程序将按预期工作:
http://mywebapp.com/signin-google
Run Code Online (Sandbox Code Playgroud)
但是,如果https使用它将无法工作; 浏览器显示以下错误:
The …Run Code Online (Sandbox Code Playgroud) 例外:
07-28 14:36:13.140: W/System.err(11382): com.google.android.gms.auth.GoogleAuthException: Unknown
07-28 14:36:13.140: W/System.err(11382): at com.google.android.gms.auth.GoogleAuthUtil.getToken(Unknown Source)
07-28 14:36:13.140: W/System.err(11382): at com.google.android.gms.auth.GoogleAuthUtil.getToken(Unknown Source)
07-28 14:36:13.148: E/AndroidRuntime(11382): FATAL EXCEPTION: main
Run Code Online (Sandbox Code Playgroud)
我的注册码:
public class Signup extends Activity {
final private String CLIENT_ID = <android-client-id>;
final private List<String> SCOPES = Arrays.asList(new String[]{
"https://www.googleapis.com/auth/plus.login"
});
private String webId = <web-client-id>;
private GoogleAccountCredential mCredential;
private EditText mExchangeCodeEditText;
private EditText mIdTokenEditText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_google);
//mExchangeCodeEditText = (EditText) findViewById(R.id.editTextExchangeCode);
// mIdTokenEditText = (EditText) findViewById(R.id.editTextIdToken);
// initiate a …Run Code Online (Sandbox Code Playgroud) Google 作为身份提供商的 Google SSO SAML 设置中的 ACS url 必须以 https 开头。因此,我无法使用本地主机 url。有没有办法在本地服务器上测试 Google SSO SAML?我需要输入什么网址(或其他详细信息)?
python single-sign-on saml-2.0 google-sso google-cloud-platform
我正在使用 Google/G Suite 为我们的应用程序进行 SAML SSO 集成。我们的客户在他们公司的 G Suite 管理设置中配置我们的 SAML 应用程序。在大多数情况下,集成工作正常:
但是,在这种情况下,SSO 会失败:
这给我们的用户带来了非常混乱的体验。您目前只登录了一个不是您公司的 google 帐户的 google 帐户,这是很常见的。此外,错误页面是不透明的——用户不清楚他们做错了什么。
有没有办法始终显示帐户选择器?例如,我们可以向/o/saml2/idpurl 或 SAML AuthnRequest添加任何参数吗?(例如,我们尝试在 AuthnRequest 中设置ForceAuthn和添加一个<saml:Subject>块,但似乎 Google 的 SAML 也不支持。)
或者有没有办法让我们的应用程序在错误时获得回调,以便我们可以显示更有意义的错误消息?
(我联系了 G Suite 支持,他们说要在 Stack Overflow 上问我们的问题。感谢您的帮助!)
我们最近在我们的平台上引入了 Google 单点登录。除了一个问题外,它运行良好。我们所有的开发分支都会自动分配一个类似于 的 url https://{branch-name}.ourdomain.com。截至目前,我们必须为每个环境手动添加授权源,这对我们来说是不可扩展的。
是否有一种解决方案(例如我们可以在部署过程中使用的 API),不需要我们从同一源为所有分支进行授权并进行重定向舞蹈?理想的解决方案是通配符解决方案,我们可以将其添加https://*.ourdomain.com为授权来源,但这在 Google Cloud Platform 中似乎不允许。
如Google文档所述,您可以将Google Apps用作SAML 2.0 IdP。IdP元数据包含SSO的URL,但不包含SLO URL:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" entityID="https://accounts.google.com/o/saml2?idpid=XXXXXXXX" validUntil="xxxxxxx">
<md:IDPSSODescriptor WantAuthnRequestsSigned="false" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
<md:KeyDescriptor use="signing">
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:X509Data>
<ds:X509Certificate>....</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
</md:KeyDescriptor>
<md:NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress</md:NameIDFormat>
<md:SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="https://accounts.google.com/o/saml2/idp?idpid=XXXXXXXXX"/>
<md:SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://accounts.google.com/o/saml2/idp?idpid=XXXXXXXXX"/>
</md:IDPSSODescriptor>
</md:EntityDescriptor>
Run Code Online (Sandbox Code Playgroud)
尝试仅对SLO使用相同的URL会导致Google错误:
Error parsing the request, malformed_request: The SAML request is malformed. That’s all we know.
Run Code Online (Sandbox Code Playgroud)
当然,您可以重定向到https://accounts.google.com/logout,但这只会结束Google会话。
Google文档中未提及SLO。支持吗?
google-sso ×8
saml-2.0 ×3
google-apps ×2
google-oauth ×2
saml ×2
android ×1
asp.net-core ×1
google-api ×1
nginx ×1
python ×1