spring-security-saml2

spring-security saml2 : How to obtain the current user?

我的未来我决定 提交于 2020-06-27 16:52:06
问题 I'm working with spring-security and spring-security-saml2-service-provider with versions 5.2.0.RELEASE. I'm trying after authentication by IDP to obtain the current Assertion in order to map it to a user in our local system. I use this code to obtain the Saml2Authentication object @Component @Log4j public class EventListener implements ApplicationListener<InteractiveAuthenticationSuccessEvent> { @Override public void onApplicationEvent(InteractiveAuthenticationSuccessEvent

Combine database and SAML authentication in one application using spring security

送分小仙女□ 提交于 2020-04-30 07:11:20
问题 I am trying to implement authentication and authorization in the spring boot(2.2.4) app using spring security(spring-security-starter). Use Case: Based on the username I want to redirect the user for the specific authentication provider If username ends with 'mit.com' Authenticate User using database (I am using hibernate)- For this, I can use spring's UserDetailService If username ends with 'einfochips.com' Authenticate User using SAML 2.0 protocol- Using identity provider like Okta,

Spring SAML Security Certificate Caching Issue

和自甴很熟 提交于 2020-03-05 06:05:35
问题 I am using Spring security SAML 1.0.3 Release version. I figured out a problem that if we upload a certificate for the IDP it does not get reflected in the Spring SAML. The problem seems to be with MetadataCredentialResolver where there is a cache Map Map<MetadataCacheKey, SoftReference<Collection<Credential>>> cache; It is picking the certificate from the cache and hence the newer uploaded cert is ignored. Is there a way I can reset the cache? 回答1: I think the way to get rid of cache is to

java.lang.ClassCastException: org.opensaml.core.xml.schema.impl.XSAnyBuilder cannot be cast to org.opensaml.xml.XMLObjectBuilder

拟墨画扇 提交于 2019-12-11 13:44:31
问题 In our application, we are trying to upgrade to Spring boot 2, We are using spring-security-saml2-core:1.0.4.RELEASE , while running application we are getting following exception. It seems, there are two jars xmltooling-1.4.6 and opensaml-core-3.3.0 on classpaath, who have same file default-config.xml . In this case a classloader happens to put opensaml-core-3.3.0 ahead of xmltooling-1.4.6.jar and wrong default-config.xml getting loaded <ObjectProviders> <ObjectProvider qualifiedName="xt

How to use Spring SAML code with jks or signed metdata

时光毁灭记忆、已成空白 提交于 2019-12-11 06:36:59
问题 The IDP only provided .crt file and metadata xml file, and IDP told us there is no password for .crt file, I created jks file with command:keytool -import -alias zoom -trustcacerts -file qa.crt -keystore keystory.jks. Now,I downloaded the spring SAML demo code, and changed the securiyContext.xml as bellow: --------matadata.xml--------------------- <md:EntityDescriptor entityID="gene.com" cacheDuration="PT1440M" ID="dfhGJ7yKW7C3nvicVEN.puf7bSh" xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata">