cancel
Showing results for 
Search instead for 
Did you mean: 

Changing the default SAML Keystore location

2,972

Hi,

We are trying to setup the SAML extension in our codebase. We have generated the jks(keystore) file and the metadata.xml files. Once we place the keystore and the metadata.xml file in the path hybris\bin\ext-integration\samlsinglesignon\resources\security everything works fine.

However, when we place these files (keystore and metadata.xml) in the config/security folder, and change the properties in local.properties as below,

sso.metadata.location=${HYBRIS_CONFIG_DIR}/security/metadata.xml sso.keystore.location=${HYBRIS_CONFIG_DIR}/security/samlKeystore.jks

The metadata.xml file is picked up properly, while there are below errors in server startup.

ERROR [localhost-startStop-1] [JKSKeyManager] Error initializing key store java.io.FileNotFoundException: Could not open ServletContext resource [/C:/Hybris6/hybris/config/security/samlKeystore.jks] at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:141) ~[spring-web-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.security.saml.key.JKSKeyManager.initialize(JKSKeyManager.java:115) [spring-security-saml2-core-1.0.1.RELEASE.jar:1.0.1.RELEASE] at org.springframework.security.saml.key.JKSKeyManager.(JKSKeyManager.java:79) [spring-security-saml2-core-1.0.1.RELEASE.jar:1.0.1.RELEASE] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_51] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [?:1.8.0_51] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [?:1.8.0_51] at java.lang.reflect.Constructor.newInstance(Constructor.java:422) [?:1.8.0_51] at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147) [spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:122) [spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:267) [spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1139) [spring-beans-4.1.7.RELE ASE.jar:4.1.7.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1042) [spring-beans-4.1.7.RELEA

View Entire Topic
jesus-maica
Discoverer
0 Kudos

This worked for me:

sso.keystore.location=file\:${HYBRIS_BIN_DIR}/ex.....