Tag: saml 2.0

在解密Saml令牌时获取错误

我在解密saml令牌时遇到错误。 但是,重新启动服务器后,此问题不一致。 它工作正常,直到昨晚:( DEBUG Decrypter:631 – Attempt to decrypt EncryptedKey using credential from KEK KeyInfo resolver failed: org.opensaml.xml.encryption.DecryptionException: Probable runtime exception on decryption:unknown parameter type. at org.opensaml.xml.encryption.Decrypter.decryptKey(Decrypter.java:705) at org.opensaml.xml.encryption.Decrypter.decryptKey(Decrypter.java:628) at org.opensaml.xml.encryption.Decrypter.decryptUsingResolvedEncryptedKey(Decrypter.java:783) at org.opensaml.xml.encryption.Decrypter.decryptDataToDOM(Decrypter.java:524) at org.opensaml.xml.encryption.Decrypter.decryptDataToList(Decrypter.java:442) at org.opensaml.xml.encryption.Decrypter.decryptData(Decrypter.java:403) at org.opensaml.saml2.encryption.Decrypter.decryptData(Decrypter.java:141) at org.opensaml.saml2.encryption.Decrypter.decrypt(Decrypter.java:69) at org.springframework.security.saml.websso.WebSSOProfileConsumerImpl.processAuthenticationResponse(WebSSOProfileConsumerImpl.java:199) at org.springframework.security.saml.SAMLAuthenticationProvider.authenticate(SAMLAuthenticationProvider.java:82) at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:156) at org.springframework.security.saml.SAMLProcessingFilter.attemptAuthentication(SAMLProcessingFilter.java:84) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:195) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192) […]

SAML Http请求拦截与Spring Boot

参考此SO问题使用Spring Security SAML向SAML请求添加请求参数 我想用我自己的默认HTTPRedirectDeflateBinding bean替换默认的HTTPRedirectDeflateBinding bean,它有一个自定义HTTPRedirectDeflateEncoder来向我的SAML请求添加查询参数。 我正在尝试使用Spring Boot @Bean自动配置注释实现这一点,并且是Java环境的新手,我似乎无法使其正常工作。 我可以看到我的bean在启动时正在注册,但是出站的HTTP请求没有被它拦截,看起来原来的redirectBinding仍然是。 这是我添加到Configuration类中的bean: @Bean(name=”redirectBinding”) @Primary public HTTPRedirectDeflateBinding HTTPRedirectDeflateBinding() { return new HTTPRedirectDeflateBinding(null, new My_SAML_HttpRedirectDeflateEncoder()); } 这是我的编码器我试图传递到重定向绑定 public class My_SAML_HttpRedirectDeflateEncoder extends HTTPRedirectDeflateEncoder{ @Override protected String buildRedirectURL(SAMLMessageContext messagesContext, String endpointURL, String message) throws MessageEncodingException { URLBuilder urlBuilder = new URLBuilder(endpointURL); List<Pair> queryParams = urlBuilder.getQueryParams(); if (messagesContext.getOutboundSAMLMessage() instanceof RequestAbstractType) { […]

使用OpenSAML在Java中使用SAML 2.0解密加密的断言

尝试使用SAML 2.0解密加密断言时遇到问题。 我使用的库是OpenSAML Java库2.5.2。 加密的断言如下所示: 1H3mV/pJAlVZAst/Dt0rqbBd67g= … ENCRYPTED KEY HERE … … ENCRYPTED ASSERTIONS HERE … 我确实使用以下openssl命令将PEM格式的私钥转换为pkcs8格式: openssl pkcs8 -topk8 -nocrypt -inform PEM -in rsa_private_key.key -outform DER -out rsa_private_key.pk8 然后我准备尝试解密加密的断言。 这是我的Java代码: … // Load the XML file and parse it. File xmlFile = new File(“data\\token.xml”); InputStream inputStream = new FileInputStream(xmlFile); Document document = parserPoolManager.parse(inputStream); Element […]

使用SAMLResponse令牌

基于SAML sp的身份validation具有以下简短的工作流程 用户想要在sp访问应用程序。 sp将SAMLRequest令牌发送到idp。 idp使用它并生成SAMLResponse令牌。 idp将此SAMLResponse令牌发送到sp给出的AC-URL。 我的问题是sp如何使用此SAMLResponse令牌。 逻辑是什么? 如果我能获得一些JAVA代码帮助它将是有益的。