标签: opensaml

为了实现SAML,我是否需要在主机上安装Shibboleth SP?

我收到了几个SAML实施问题,以澄清我的困惑......

我需要在java web应用程序中实现SSO.

  1. 为了做到这一点,我需要我的主机上安装Shibboleth的SP 像这样,我也可以通过提供的OpenSAML SP的功能?

  2. 我假设shibboleth与OpenSAML一样,但只是在Web服务器级别,而OpenSAML将在软件方面执行.这个假设是否正确?

编辑:所以shibboleth(根据Scott Cantor)是用OpenSAML构建的......我的假设是否仍然存在?

  1. 使用OpenSAML需要什么?只是IdP网址和idP注册?

  2. 我是否需要提供SP目录,例如ActiveDirectory/LDAP?

编辑:感谢您的回答,但有人可以直接回答上述问题并详细说明......

java saml shibboleth opensaml

6
推荐指数
2
解决办法
6666
查看次数

SSO - SAML,成功登录后将用户重定向到指定的登录页面

我正在实施SSO,我是身份提供商,现在我能够成功登录服务提供商.但它需要我到主页.我想在发布回复时指定着陆页网址.搜索了很多但找不到令人信服的东西.不太清楚SAML响应的哪个元素带有Landing页面URL,或者是我必须指定的格式.使用java和opensaml库生成响应.

saml single-sign-on opensaml

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

AssertionConsumerServiceURL,Destination,Consent in <saml:AuthnRequest>之间的区别

我一直在尝试使用opensaml-java生成SAML对象.

参考:幻灯片#30在https://www.oasis-open.org/committees/download.php/12958/SAMLV2.0-basics.pdf

<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
                        ForceAuthn="true"
                        AssertionConsumerServiceURL="http://www.example.com/"
                        AttributeConsumingServiceIndex="0" ProviderName="string"
                        ID="abe567de6"
                        Version="2.0"
                        IssueInstant="2005-01-31T12:00:00Z"
                        Destination="http://www.example.com/"
                        Consent="http://www.example.com/" >
Run Code Online (Sandbox Code Playgroud)

在此Destination,Consent,AssertionConsumerServiceURL中,所有三个代表相同的地址. 他们实际代表什么?

[问题1] 它们之间有什么区别吗? 当然必须有一些区别,否则他们就不会有这三件事.

或者如果没有差异,他们代表什么?

编辑1:AssertionConsumerServiceURL是IdP的登陆页面,其中预期来自IdP的断言响应消息.

java opensaml saml-2.0

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

如何使用OpenSAML设置Signature DigestMethod算法

我们可以将签名算法设置如下:

signature.setSignatureAlgorithm("http://www.w3.org/2001/04/xmldsig-more#rsa-sha256");
Run Code Online (Sandbox Code Playgroud)

我正试图找到一种方法来设置DigestMethod算法.是否可以通过OpenSAML API?任何输入都非常感谢.

更新:为清晰度添加样本签名.这个问题关注的是它中的DigestMethod元素.

<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
    <ds:SignedInfo>
      <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
      <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
      <ds:Reference URI="#_884D49DAD03AD60748547F8322C11AA0">
        <ds:Transforms>
          <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
          <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
        </ds:Transforms>
        <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
        <ds:DigestValue>...</ds:DigestValue>
      </ds:Reference>
    </ds:SignedInfo>
    <ds:SignatureValue>...</ds:SignatureValue>
    <ds:KeyInfo>
      <ds:KeyName>...</ds:KeyName>
    </ds:KeyInfo>
  </ds:Signature>
Run Code Online (Sandbox Code Playgroud)

更新:弗拉基米尔的答案有效.但是,该解决方案似乎线程不安全?在我的应用程序中,我们只引导opensaml一次,然后由具有不同配置的不同线程使用 - 如不同的签名算法.有没有办法以线程安全的方式执行此操作?

更新:Shibboleth IdP使用opensaml,根据Shibboleth IdP Wiki,目前这是一个全局配置.因此,无论IdP还是SP方面,如果opensaml用于处理SAML消息,则应该存在此限制.以下是该文章的摘录:

更改IdP签名/摘要算法和相关设置目前是全局操作.该算法将针对与其交互的所有依赖方进行更改.在您确认所有依赖方都可以使用您选择的新算法处理响应之前,请不要进行此更改

更新:终于找到了完成这项工作的方法.添加了它作为答案.

opensaml

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

java.security.SignatureException 签名长度不正确:得到 128 但期望 512

我正在使用 Shiboleth opensaml ( http://shibboleth.net/downloads/java-opensaml/ ) 库进行 SAML,最近,在升级库后(升级的原因是 NoSuchMethodError),服务器在服务器期间开始抛出以下异常启动:

[SigningUtil] 使用 RSA 类型的公钥和 JCA 算法 ID SHA1withRSA 验证输入签名 [SigningUtil] 签名验证期间出错 原因:java.security.SignatureException:签名长度不正确:得到 128,但期望 512

一般来说,是什么原因导致这个问题呢?这在我的本地 Windows 系统上没有发生。(JVM:1.7.0_71(Oracle Corporation 24.71-b01)操作系统:Windows 7 6.1 amd64),但仅在基于 Linux 的系统上发生。

期待一些建议或给我指出一些文章。提前致谢。

java security jce opensaml

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

OpenSaml3文档

有谁知道OpenSaml3是否有任何文档?支付还是其他?我知道曾经有一本15美元的书可用,但我相信它只涵盖OpenSaml2.

我知道这可能会被投票,因为它不是一个特定于编程的问题,但Spring-Saml现在将SO列为主要论坛(http://projects.spring.io/spring-security-saml/).如果没有一个好的库,SAML很难实现,我认为Spring-SAML是在JVM上编写的人最好的东西.因为Spring-Saml看起来被抛弃了,OpenSaml2很快就会终结.我想看看我是否可以更新Spring Saml以使用更新支持的OpenSAML版本,但除了src代码之外似乎没有文档(没有迁移指南,甚至是已发布的javadoc).任何人都可以指出我正确的方向.

java spring-security saml opensaml spring-saml

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

SAMLException: Response has invalid status code status message is null

Im trying to implement spring-securtiy-saml integration as a SP with an adfs system, and im bumping my head for some days now with this exception happening when SAMLResponnse is sent back from the ADFS after successful authentication and the following exception is thrown. this is the DEBUG log:

2017-10-02 18:05:09,246 - DEBUG [http-apr-443-exec-9] BaseMessageEncoder - Successfully encoded message.
2017-10-02 18:05:09,246 - INFO  [http-apr-443-exec-9] SAMLDefaultLogger - AuthNRequest;SUCCESS;208.95.100.30;saml2.glassboxdigital.com;http://this/is/a/valid/url;;;
2017-10-02 18:05:09,859 - DEBUG [http-apr-443-exec-3] SAMLProcessingFilter - Request is to process authentication
2017-10-02 18:05:09,860 …
Run Code Online (Sandbox Code Playgroud)

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

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

OpenSAML v3 - 验证 SAML 响应

我们正在为 IDP 发起的 SSO 实施服务提供商。我们使用 openSAML v3 java library来解析使用 POST 的 SAML 响应。

我想验证 SAML 数据和格式,因此试图弄清楚是否有任何内置方法可以用来验证 SAML 数据。我可以使用 SAMLSignatureProfileValidator 和 SignatureValidator 验证签名,但我还想验证 SAML 版本、实体提供者、受众、条件等。

当我深入研究库时,我发现调用 doInvoke() 方法时WSSecuritySAML20AssertionTokenSecurityHandler进行验证的类SAML,但消息应该是 SOAP。此方法使用 SAML20AssertionValidator 进行验证。

我计划使用 SAML20AssertionValidator 来验证断言,因此我需要帮助来实例化 SAML20AssertionValidator。SAML20AssertionValidator 的构造函数如下。尝试理解输入参数

public SAML20AssertionValidator(@Nullable final Collection<ConditionValidator> newConditionValidators,
        @Nullable final Collection<SubjectConfirmationValidator> newConfirmationValidators,
        @Nullable Collection<StatementValidator> newStatementValidators, 
        @Nullable final SignatureTrustEngine newTrustEngine,
        @Nullable final SignaturePrevalidator newSignaturePrevalidator) {
Run Code Online (Sandbox Code Playgroud)

还想确保这是否是验证的正确方向,或者我可以使用其他方法吗?

非常感谢对此的任何指示。

opensaml saml-2.0

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

如何在java或node中为SAML创建自己的IDP

我想创建一个供多个应用程序使用的 SSO,最好的方法是什么。我正在经历 SAML2.0,但我很困惑,因为我没有\xe2\x80\x99 找到任何创建自己/自定义 SAML IDP 的文章。

\n\n

1.创建自己的IDP是否可行。
\n2.What is the best way to implement SSO

\n

saml opensaml saml-2.0 spring-saml

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

使用 OpenSaml 在 AuthnRequest 的签名中生成 DigestValue 和 SignatureValue

我想DigestValue开始SignatureValue使用OpenSaml。SignatureAuthnrequest

最近生成的 authnrequest 是..

<?xml version="1.0" encoding="UTF-8"?>
<samlp:AuthnRequest 
    xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" 
    AssertionConsumerServiceURL="http://idp.com/sso" 
    Destination="https://idp.com/authenticate" 
    ForceAuthn="false" 
    ID="a4df2939df77bfb81a590cb32bb600632746b2a4f3" 
    IsPassive="false" 
    IssueInstant="2020-01-01T10:16:25.205Z" 
    ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" 
    Version="2.0">
    <samlp:Issuer xmlns:samlp="urn:oasis:names:tc:SAML:2.0:assertion">https://sp.com/</samlp:Issuer>
    <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
        <ds:SignedInfo>
            <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
            <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
            <ds:Reference URI="#a4df2939df77bfb81a590cb32bb600632746b2a4f3">
                <ds:Transforms>
                    <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
                    <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
                </ds:Transforms>
                <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
                <ds:DigestValue />
            </ds:Reference>
        </ds:SignedInfo>
        <ds:SignatureValue />
        <ds:KeyInfo>
            <ds:X509Data>
                <ds:X509Certificate>
                    MIICnDCCAgWgAwIBAgIBA...
                </ds:X509Certificate>
            </ds:X509Data>
        </ds:KeyInfo>
    </ds:Signature>
    <saml2p:NameIDPolicy xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" AllowCreate="true" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient" />
</samlp:AuthnRequest>
Run Code Online (Sandbox Code Playgroud)

上面AuthnRequest两个节点都是空的(DigestValueSignatureValue)。

  1. 那么如何为它们设置值。

  2. 还有一个问题是如何ds:Signature. …

java xml opensaml saml-2.0

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