使用密钥库启动SAML期间发生错误

时间:2018-12-04 12:00:07

标签: saml-2.0

对于使用SAML,我已经配置了Maven和应用程序上下文。

执行以下2条命令时,我输入了密码。 openssl pkcs12-导出-in certificate.crt -inkey private.pem -certfile certificate.crt -out keystore.p12

keytool -importkeystore -srckeystore keystore.p12 -srcstoretype pkcs12 -destkeystore samlKeystore.jks -deststoretype JKS

我已将samlKeystore.jks sp.metadata.xml v2metadata.xml文件放在src / main / resources / metadata /

但是出现以下错误。

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChains': Cannot resolve reference to bean 'org.springframework.security.web.DefaultSecurityFilterChain#0' while setting bean property 'sourceList' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.DefaultSecurityFilterChain#0': Cannot resolve reference to bean 'samlFilter' while setting constructor argument with key [3]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'samlFilter' defined in class path resource [conf/spring/root-context.xml]: Cannot create inner bean '(inner bean)#6ddc817f' of type [org.springframework.security.web.DefaultSecurityFilterChain] while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#6ddc817f': Cannot resolve reference to bean 'samlEntryPoint' while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'samlEntryPoint': Unsatisfied dependency expressed through method 'setWebSSOprofile' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webSSOprofile': Unsatisfied dependency expressed through method 'setMetadata' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'metadata': Unsatisfied dependency expressed through method 'setKeyManager' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'keyManager' defined in class path resource [conf/spring/root-context.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.security.saml.key.JKSKeyManager]: Constructor threw exception; nested exception is java.lang.RuntimeException: Error initializing keystore

是因为设置了密码吗?

更新1 : 在应用程序上下文中,我注意到以下条目。这是设置密码的地方吗?

<bean id="keyManager" class="org.springframework.security.saml.key.JKSKeyManager">
    <constructor-arg value="classpath:/metadata/samlKeystore.jks" />
    <constructor-arg type="java.lang.String" value="storepass" />
    <constructor-arg>
      <map>
        <entry key="saml-alias" value="keypass" />
      </map>
    </constructor-arg>
    <constructor-arg type="java.lang.String" value="saml-alias" />
  </bean>

更新2 我进一步查看了日志,发现以下错误消息

java.io.IOException: Keystore was tampered with, or password was incorrect
Caused by: java.security.UnrecoverableKeyException: Password verification failed

如何设置密钥库的密码

0 个答案:

没有答案