How can I find out which XML parameters have a Spring config tag?

I was just reading an article that showed the following Spring Security Configuration:

<authentication-provider>  
  <password-encoder hash="sha" />  
  <jdbc-user-service data-source-ref="dataSource" />  
</authentication-provider>

      

I wondered if the password encoder could take some combination of options that would force it to use SHA-256. I easily found a Java constructor for ShaPasswordEncoder , but how can I tell if a passwords-encoder tag takes an argument for a Java object

In general, how can you determine what the tags and parameters for Spring configuration are?

For example, how do you know that this ShaPasswordEncoder comes with "encoder-encoder" (if it really is)?

+2


source to share


1 answer


You are looking at XML Schema . For example:

<xs:attribute name="hash">
  <xs:annotation>
    <xs:documentation>
      Defines the hashing algorithm used on user passwords. We recommend
      strongly against using MD4, as it is a very weak hashing algorithm.
    </xs:documentation>
  </xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:token">
      <xs:enumeration value="plaintext"/>
      <xs:enumeration value="sha"/>
      <xs:enumeration value="sha-256"/>
      <xs:enumeration value="md5"/>
      <xs:enumeration value="md4"/>
      <xs:enumeration value="{sha}"/>
      <xs:enumeration value="{ssha}"/>
    </xs:restriction>
  </xs:simpleType>
</xs:attribute>

      



So, you have to do this:

<authentication-provider>  
  <password-encoder hash="sha-256" />  
  <jdbc-user-service data-source-ref="dataSource" />  
</authentication-provider>

      

+2


source







All Articles