- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我想实现一个简单的场景:
作为信息系统(服务提供商)我使用 OIOSAML 。基于 Shibboleth 的远程 idP (在客户方面,我对此一无所知。只知道它是在Shibboleth的基础上编写的)
来自 docs :
The OIOSAML.java Service Provider package implements a Servlet-compliant SAML Service Provider for use in a SAML federation. The package implements all necessary functionality to work as a OIOSAML compliant Service Provider.
The main component of the package is a servlet filter which handles user authentication. The filter checks if the user is already authenticated, and if not, the user is redirected to the SAML Identity Provider. When the user returns with a SAML assertion, the assertion is validated, and a new session is created for the user. The application can access the received assertion and its attributes through a programming API.
IdP and Service Provider configuration is handled through standard SAML metadata.
我的 web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
<display-name>OIOSAML-J</display-name>
<listener>
<listener-class>dk.itst.oiosaml.sp.service.session.SessionDestroyListener</listener-class>
</listener>
<servlet>
<servlet-name>SAMLDispatcherServlet</servlet-name>
<servlet-class>dk.itst.oiosaml.sp.service.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>SAMLDispatcherServlet</servlet-name>
<url-pattern>/saml/*</url-pattern>
</servlet-mapping>
<filter>
<filter-name>LoginFilter</filter-name>
<filter-class>dk.itst.oiosaml.sp.service.SPFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>LoginFilter</filter-name>
<url-pattern>/protected/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
我的 oiosaml-sp.properties:
# Properties used by oiosaml-j
# Reference to the location of the certificate used for signing SAML documents with - relative to ${oiosaml.home}
oiosaml-sp.certificate.location=./certificate/keystore
# Opaque/encrypted password to the certificate used for signing SAML documents
oiosaml-sp.certificate.password=some_password
# Required authentication level. 2=password, 3=certificate
oiosaml-sp.assurancelevel=2
# Name of the meta data file for the current service provider - overrides setting in brs-common.properties
common.saml2.metadata.sp.filename=SPMetadata.xml
# URI References to the current service provider
oiosaml-sp.uri.home=
# Whether to validate server certificates. Set to false in production.
# Used for artifact resolution.
oiosaml-sp.resolve.ignorecert=true
# Artifact resolution username and password. Only used the artifact profile is active.
oiosaml-sp.resolve.username=rolf.trifork.com
oiosaml-sp.resolve.password=rolf.trifork.com
已生成 AuthnRequest
:
<?xml version="1.0" encoding="UTF-8"?>
<saml2p:AuthnRequest xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol"
AssertionConsumerServiceURL="http://.../saml/SAMLAssertionConsumer"
Destination="https://someidentityprovider/idp/profile/SAML2/Redirect/SSO" ForceAuthn="false"
ID="_183...4" IsPassive="false"
IssueInstant="2014-07-10T05:48:02.564Z"
ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Version="2.0">
<saml2:Issuer xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">some_information</saml2:Issuer>
</saml2p:AuthnRequest>
结果URLEncode
字符串:
https://someidentityprovider/idp/profile/SAML2/Redirect/SSO?SAMLRequest=fVL...x3%2B8w%2Fws%3D
&RelayState=_27a...b8d25d4df
&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23dsa-sha1
&Signature=MCwCFFIXyH...%3D
系统正常工作,当我通过 protected 映射执行请求时,我得到身份提供者的登录页面,我可以在其中输入一对登录名/密码以继续。但是,标识提供者发送此响应:
<?xml version="1.0" encoding="UTF-8"?>
<saml2p:Response xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" Destination="..."
ID="_3d00f0e5401c168ab42eeafc78726e5e" InResponseTo="_b67...3c10"
IssueInstant="2014-07-10T15:33:56.788Z" Version="2.0">
<saml2:Issuer xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"
Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">
https://.../shibboleth
</saml2: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="#_3d00f0...726e5e">
<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>yq/0...I=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>
IR76Xd51+Vwi...w==
</ds:SignatureValue>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate>MIID...zQG</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
</ds:Signature>
<saml2p:Status>
<saml2p:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Responder"/>
<saml2p:StatusMessage>Unable to encrypt assertion</saml2p:StatusMessage>
</saml2p:Status>
</saml2p:Response>
所以,
<saml2p:Status>
<saml2p:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Responder"/>
<saml2p:StatusMessage>Unable to encrypt assertion</saml2p:StatusMessage>
</saml2p:Status>
这是什么意思以及如何克服它?
最佳答案
身份提供者需要拥有您的 OIOSAML 应用程序的公共(public)证书,以便能够在将响应发送回 OIOSAML 之前加密断言。错误消息可能表明它丢失了。
您能否验证包含您导入到 Shibboleth 的 OIOSAML 应用程序信息的 SAML 元数据是否包含元素 <md:KeyDescriptor use="encryption">
有证书信息吗?
作为解决方法,您可以在 HTTPS 端口上部署 OIOSAML 应用程序(在元数据中生成 URL,例如 https://localdomain.com:8443/..。)并将元数据重新导入 Shibboleth。默认情况下,Shibboleth 不会尝试加密断言,以防断言通过加密 channel 返回给服务提供商应用程序。
关于java - OIOSAML AuthnResponse : Unable to encrypt assertion,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24682384/
关闭。这个问题需要多问focused 。目前不接受答案。 想要改进此问题吗?更新问题,使其仅关注一个问题 editing this post . 已关闭 8 年前。 Improve this ques
我heard “PKCS#1 v2.0 加密通常称为 OAEP 加密”。 在我的项目中使用它之前,我需要某种“官方”文档来说明这一点。我试图找到它但没有成功。知道在哪里可以找到吗? 谢谢! (顺便说一
已锁定。这个问题及其答案是locked因为这个问题是题外话,但却具有历史意义。目前不接受新的答案或互动。 来自:加密公司 收件人:x$*sj4(就是你) 如果您选择接受的话,您的任务是用最短的击键次数
我正在使用带有 docker/docker compose 和 traefik 的 ubuntu 18.04.1 LTS。使用暂存 Let's Encrypt caserver ( https://a
我目前正在完成一篇关于通过各种密码算法加密数据的论文。 我花了很多时间阅读期刊和论文,但还没有找到任何关于它们的性能复杂性的记录。 有人知道以下算法的 Big-O 复杂度吗? RSA DES 三重 D
我正在为嵌入式系统(微 Controller )编写固件。固件可以通过引导加载程序(也是我编写的)进行更新。 现在需要采取措施防止固件被操纵,因此系统必须仅执行具有某种有效签名的下载固件。 固件文件已
我试图了解加密(“受密码保护”)Office 2007 文档(特别是 Excel 文档)的捆绑方式。我正在试验一个已知的、受密码保护的电子表格。 当我解压 XLSX 文件时,我遇到了三个条目: [6]
K8s对encrypt secret data具有此功能,这需要修改kube-apiserver配置,我如何在GKE中做到这一点? 最佳答案 简短的答案是,你不能。 Kubernetes Engine
我正在使用 ENCRYPT() 函数在 mysql 中存储一个字符串。我想获取匹配该字符串的行,但新的 ENCRYPT() 调用给了我一个不同的值,因此它们永远不会匹配。 这是预期的,因为我没有(也不
在带有 Python 2.7 和 GPG4Win v2.2.0 的 Windows 7 上使用 python-gnupg v0.3.5 test_gnupg.py 导致 2 次失败: Test tha
我尝试兼容 C# 和 Java 的加密/解密。 据我所知,默认模式在 Java 中是“ecb/pkcs5”,在 C# 中是“cbc/pkcs7”。 所以我匹配这些东西。 第一个问题是 PKCS7 和
我使用 SwiftyRSA 使用带有 PKCS1 填充的公钥加密字符串。不幸的是,当我用 Java 解密我的加密字符串时,我发现了 BadPadding: Encryption Error。到目前
比特币是一种匿名的加密数字货币。几个月前我有了加密文件的想法,其中需要比特币的支出证明才能解密文件。当比特币被发送到给定地址时,它会显示在分布在对等网络中的块文件中。区块链的完整性是通过需要大量计算机
我有一个类,我试图用依赖注入(inject)替换 Crypt::encrypt 的外观用法: encrypter= $encrypter; }
我想使用带有 RSA 算法的 OpenSSL 使用私钥加密文件: openssl rsautl -in txt.txt -out txt2.txt -inkey private.pem -encryp
我在 TCL 中使用 DES 来加密一些短语,我想将这些加密的短语存储在一些我需要轻松操作的 ascii 文件中。因此,我希望“加密短语”仅由标准 ascii 字符构成(最好没有空格)。 我正在使用类
我在 TCL 中使用 DES 来加密一些短语,我想将这些加密的短语存储在一些我需要轻松操作的 ascii 文件中。因此,我希望“加密短语”仅由标准 ascii 字符构成(最好没有空格)。 我正在使用类
我对Android平台不同的数据存储加密机制有点困惑。据我了解: 全盘加密影响整个/data 磁盘并且只能是由用户激活/停用。 ( https://source.android.com/securit
我正在使用 Lumberjack 作为日志记录平台(Objective C/Swift)有没有办法将日志加密写入文件? 如果是,那么任何例子都是有用的 另外,之后如何读取加密后的日志 密集型日志记录是
我确定这是一个典型的场景,但我找不到合适的步骤顺序。 我有一个运行 Apache 的 www.example.com 服务器(比如)1.1.1.1。我正在使用 Caddy 在 2.2.2.2 上构建一
我是一名优秀的程序员,十分优秀!