标签: single-sign-on

使用 AuthType Digest 跨子域对用户进行一次身份验证的示例?

我有一个域,可供一小群私人访问。所以我想通过身份验证控制访问。

该域安装了一组应用程序,每个应用程序都有自己的子域。例如:domain.com、app1.domain.com、app2.domain.com、app3.domain.com

我很想有一个单点登录解决方案,这样他们就不必为每个应用程序进行身份验证。此外,应用程序是用不同的语言(PHP、Python 和 Perl)编写的,因此通过 Apache 模块对用户进行身份验证是理想的。

我是消化身份验证的新手,但这似乎是一个很好的解决方案。我曾经htdigest创建过我的用户。我已经配置了我的域和子域(见下文)。

如果我转到域或任何子域,它会提示输入用户名和密码。如果我输入正确的用户名和密码,它将对我进行身份验证并加载页面。但是,如果我转到另一个子域,它会要求我再次输入用户名和密码。如果我输入相同的用户名和密码,它将起作用。

所以密码文件没问题,认证也没问题,但问题好像出在AuthDigestDomain.

我在网上搜索了一个在多个域上使用摘要式身份验证的示例,但找不到解决我问题的具体示例。

我希望这里有人可以提供帮助。我是否将相同的身份验证信息放入每个Directory? 我应该使用DirectoryLocationFiles?我错过了什么吗?

提前致谢!

下面是我的 domain.com 的 Apache 配置示例:

<Directory /var/www>
  AuthType Digest
  AuthName "realm"
  AuthDigestAlgorithm MD5
  AuthDigestDomain / http://domain.com/ http://app1.domain.com/ http://app2.domain.com/ http://app3.domain.com/
  AuthDigestNcCheck Off
  AuthDigestNonceLifetime 0
  AuthDigestQop auth
  AuthDigestProvider file
  AuthUserFile /etc/apache2/.htpasswd-digest
  AuthGroupFile /dev/null
  Require valid-user
</Directory>
Run Code Online (Sandbox Code Playgroud)

这是 app1.domain.com 的示例:

<Directory /var/lib/app1>
  AuthType Digest
  AuthName "realm"
  AuthDigestAlgorithm MD5
  AuthDigestDomain / http://domain.com/ http://app1.domain.com/ http://app2.domain.com/ http://app3.domain.com/
  AuthDigestNcCheck Off
  AuthDigestNonceLifetime …
Run Code Online (Sandbox Code Playgroud)

apache authentication subdomain digest single-sign-on

5
推荐指数
1
解决办法
2万
查看次数

为什么不同域中的浏览器根本不响应 mod_auth_kerb 发送的“WWW Authenticate : Negotiate”标头?

我已经在我们的 apache-active 目录环境中通过 mod_auth_kerb 实现了 SSO,它按预期工作。然而,以下知识困扰着我:

我从两台客户机请求 Kerberos 保护页面,一个用户属于 Kerberos-setup 域,另一个用户属于某个其他域。然后我比较了两台机器上的 HTTP 数据包。在两台机器上,发送对 Kerberos 保护页面的请求后,服务器使用以下 HTTP 数据包进行响应:

HTTP/1.1 401 需要授权日期:2012 年 9 月 5 日星期三 14:25:20 GMT 服务器:Apache WWW-Authenticate : Negotiate WWW-Authenticate: Basic realm="Kerberos Login" Content-Length: 60 Connection: close Content-Type: text/html; 字符集=iso-8859-1

但是,在来自服务器的上述响应之后,属于 Kerberos-setup 域的客户端计算机的浏览器以WWW-Authenticate响应:Negotiate 'token',而其他客户端浏览器(属于某个其他域的用户)根本不响应.

现在我的理解是,属于另一个域的客户端也应该用它自己的 TGT+Session 密钥令牌进行响应,活动目录应该拒绝它。但是为什么这个客户端根本不响应服务器的WWW-Authenticate : Negotiate Challenge 超出了我的逻辑。更令人困惑的是,服务器的 HTTP 响应(上面给出)不包含有关它所链接的域的任何信息。

那么属于正确域的客户端浏览器基于什么决定它必须响应服务器的WWW-Authenticate : Negotiate挑战,而属于其他域的客户端基于什么决定不响应相同的请求?

注意:两台客户端机器都有 Windows 7,活动目录是 Windows 2008 服务器。

我正在尝试了解 mod_auth_kerb 的 SSO 实现,而这一特定知识是关键。

apache kerberos spnego gssapi single-sign-on

5
推荐指数
1
解决办法
1739
查看次数

在 PHP、Python、Ruby 应用程序之间进行单点登录的方法

有一个使用 Python Django 的项目,另一个使用 PHP 的独立项目。两者都有自己的用户身份验证。模块。将用户管理合并在一起的简单方法是什么?

我们开始检查作为CAScosign 的开源解决方案。这是一个真正的问题,在校园/大学中使用,并且不确定它是否对 Web 应用程序有好处。

在遗留应用程序之间启动单点登录 (SSO),未来将使用 Ruby 开发一些应用程序。谁能建议对 SSO 解决方案进行良好的投资?一个清晰的 API,为 Web 应用程序做好准备并且对硬件的要求不是太高会很好。

web-applications single-sign-on web

5
推荐指数
1
解决办法
1841
查看次数

apache-mod_auth_kerb; kerb_authenticate_user 使用用户 (NULL) 和 auth_type Kerberos 输入;客户没有将他们的凭据委托给我们

我正在尝试使用 Windows Server 2008 中的 ActiveDirectory 使用 kerberos 设置集成 Windows 身份验证,一切正常,我能够在成功登录时获得 kerberos 票证。我在将此票转发到配置了 Apache 的服务器时遇到问题。转发票证时 KRB5CCNAME 未在 Apache/PHP 环境变量中设置。

我的 kerberos 配置文件(krb5.conf)是

[logging]
 default = FILE:/var/log/krb5libs.log
 kdc = FILE:/var/log/krb5kdc.log
 admin_server = FILE:/var/log/kadmind.log

[libdefaults]
 default_realm = DIVAMI.COM
 default_keytab_file = /etc/krb5.keytab
 dns_lookup_realm = true
 dns_lookup_kdc = true
 ticket_lifetime = 24h
 renew_lifetime = 7d
 forwardable = true

[realms]
 DIVAMI.COM = {
  kdc = meluha.divami.com:88
  admin_server = meluha.divami.com:749
  default_domain = divami.com
 }

[domain_realm]
meluha.divami.com = DIVAMI.COM
divami.com = DIVAMI.COM
Run Code Online (Sandbox Code Playgroud)

Apache mod_auth_kerb 配置文件(auth_kerb)是

<Location /perfmon> …
Run Code Online (Sandbox Code Playgroud)

php apache kerberos single-sign-on

5
推荐指数
1
解决办法
6062
查看次数

单点登录多个 nodejs 应用程序

我们有 3 个 nodejs Web 应用程序在具有多个子域的同一个 vps 上运行相同的域名,并为每个子域实现护照身份验证。我们希望单个用户能够使用单个帐户访问所有应用程序,为此我们添加了 accounts.example.com 作为第四个应用程序,仅用于帐户管理。要求是 - 一旦用户在 accounts.example.com 中通过身份验证,如何使用户能够使用该会话访问其余三个 Web 应用程序。

single-sign-on node.js passport.js

5
推荐指数
1
解决办法
6089
查看次数

如何检查 IDP 是否仍然存在有效会话?

我已经使用 Spring Security SAML 实现了 SSO。这是目前对我有用的内容:

当我尝试访问 SP 上的任何资源时,如果我尚未登录,我将被重定向到我的 IdP(在我的情况下为 idp.ssocircle.com)。在 IDP 成功验证后,我被重定向回 SP 并授权传入的 SAML 响应并为相应的用户创建会话。一切都很酷,直到这里!但是,当我从 IDP 注销(通过从外部单击 idp.ssocircle.com 注销)时,我应该无法访问我的 SP,这在我的情况下没有发生。现在我想做的是编写一个新的过滤器,在处理 SP 上的任何请求之前检查 IDP 上的有效会话。我已经搜索了很多,但找不到任何解决我的问题的方法。

请提供有关如何实现此过滤器的输入,或者是否有其他方法可以做到这一点?任何建议表示赞赏。

spring spring-security single-sign-on saml-2.0 spring-saml

5
推荐指数
1
解决办法
2091
查看次数

Redmine:422 表单真实性令牌无效

我正在使用插件在 IDP 和 redmine 之间启用 SSO。目的是为了避免在登录redmine时重新输入用户名和密码。Redmine 和 IDP 都连接到外部 LDAP。问题是从我的 IDP 重定向回 redmine 之后(输入用户名和密码后),它给出了这个错误。

Redmine 版本:2.5.2,Ruby 版本:1.9.3,Rails 版本:3.2.19

错误

ruby authentication redmine single-sign-on redmine-plugins

5
推荐指数
1
解决办法
9721
查看次数

Google 的多重身份验证是如何工作的

您知道 Google 是如何通过一次登录来验证多个域/服务的用户的吗?(请不要只说 SSO :D)。

我的意思是:当用户访问 translate.google.com 并在此处进行身份验证时,他还会登录 google.com、gmail.com、youtube.com 等。这是如何工作的?主要问题是会话/cookie 仅适用于创建它们的域。

我在想,因为登录用户被重定向到 google.com 并且必须在那里进行身份验证。所以当他在这里登录时,他也应该登录 foo.google.com, bar.google.com.... (参见 RFC 6265 - Domain set cookie for subdomain )

但这毫无意义,因为 youtube.com 之类的域名也能正常工作。我还查看了 Firebug 的重定向,但没有 google.com。

请参阅此处的 Firebug 传输:http : //www.noppen-lehrgang.de/data/goog.png

这里还有一个谷歌在第一次访问时和登录后设置的cookies列表:noppen-lehrgang.de/data/goog2.png

我有一个 PHP 网站,可以通过不同的域访问,并希望具有这种功能(使用的域会影响内容)。我见过像 multidomain-sso ( https://github.com/0k/multidomain-sso )这样的脚本,它执行 AJAX 调用来为所有需要的域生成会话。但这感觉有点脏,尤其是当域数量增加时。

有没有人有这方面的经验?我确信它与 SSO 有关系......但在研究时我只得到像 oAuth 和 openID 这样的东西,这似乎是一种与 3rd-Party-API 通信的解决方案。

感谢您的帮助和时间!!格蒂

php authentication cross-domain google-authentication single-sign-on

5
推荐指数
0
解决办法
427
查看次数

HTTP 重定向绑定 SAML 请求

假设执行了 SP-init SSO,使用 HTTP-Redirect Binding 代替 HTTP-POST Binding 并且需要签名的 AuthnRequest。这意味着在 URL 中包含 SAMLRequest。

一季度。我需要在 URL 中包含签名还是只嵌入到 SAMLRequest 中?

重定向网址是

http://idp.example.com/SSOService.php?SAMLRequest= {val1}&Signature={val2}&SigAlg={val3}

使用我的 SAMLRequest(无签名)

<samlp:AuthnRequest ID="" Version="2.0" IssueInstant="2015-05-22T02:47:38Z" Destination="" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" AssertionConsumerServiceURL="" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
    <saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"></saml:Issuer>
    <samlp:NameIDPolicy Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" AllowCreate="true" />
    <samlp:RequestedAuthnContext Comparison="exact" />
    <saml:AuthnContextClassRef xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef>
</samlp:AuthnRequest>
Run Code Online (Sandbox Code Playgroud)

或者

http://idp.example.com/SSOService.php?SAMLRequest= {val1}

使用我的 SAMLRequest(嵌入签名)

<samlp:AuthnRequest ID="" Version="2.0" IssueInstant="2015-05-22T02:47:38Z" Destination="" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" AssertionConsumerServiceURL="" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
    <saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"></saml:Issuer>
    <samlp:NameIDPolicy Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" AllowCreate="true" />
    <samlp:RequestedAuthnContext Comparison="exact" />
    <saml:AuthnContextClassRef xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef>
    <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
        <SignedInfo>
            <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
            <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
            <Reference URI="">
                <Transforms>
                    <Transform …
Run Code Online (Sandbox Code Playgroud)

x509certificate single-sign-on saml-2.0

5
推荐指数
1
解决办法
1万
查看次数

Spring Security OAuth2 SSO 与自定义提供程序 + 注销

我正在尝试使用 Spring-boot 和 Dave Syer 示例通过 Spring Security Oauth2 实现 sso

我想使用我的自定义服务器提供商,它运行良好。

对于客户端,我希望用户在尝试访问客户端站点(例如 localhost:8080/)时进行身份验证(因此重定向到 OAuth2 url)并在身份验证后重定向回 index.html 文件。我还想在用户访问 index.html 文件中的链接时实现注销。

我想出了以下客户端 sso 客户端:

包 org.ikane;

导入 java.io.IOException;
导入 java.security.Principal;
导入 java.util.Arrays;

导入 javax.servlet.Filter;
导入 javax.servlet.FilterChain;
导入 javax.servlet.ServletException;
导入 javax.servlet.http.Cookie;
导入 javax.servlet.http.HttpServletRequest;
导入 javax.servlet.http.HttpServletResponse;

导入 org.apache.commons.lang3.StringUtils;
导入 org.slf4j.Logger;
导入 org.slf4j.LoggerFactory;
导入 org.springframework.boot.CommandLineRunner;
导入 org.springframework.boot.SpringApplication;
导入 org.springframework.boot.autoconfigure.SpringBootApplication;
导入 org.springframework.boot.autoconfigure.security.oauth2.client.EnableOAuth2Sso;
导入 org.springframework.context.ConfigurableApplicationContext;
导入 org.springframework.core.env.ConfigurableEnvironment;
导入 org.springframework.security.config.annotation.web.builders.HttpSecurity;
导入 org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
导入 org.springframework.security.core.Authentication;
导入 org.springframework.security.core.context.SecurityContext;
导入 org.springframework.security.core.context.SecurityContextHolder;
导入 org.springframework.security.web.csrf.CsrfFilter;
导入 org.springframework.security.web.csrf.CsrfToken;
导入 org.springframework.security.web.csrf.CsrfTokenRepository;
导入 …

spring-security single-sign-on spring-boot spring-security-oauth2

5
推荐指数
1
解决办法
3262
查看次数