Frage

Ich habe nur das Lesen Artikel dass die folgenden Spring Security XML-Konfiguration gezeigt:

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

Ich fragte mich, ob Passwort-Encoder eine Kombination von Parametern übernehmen könnte, die es SHA-256 machen würden verwenden. Ich fand einfach den Java-Konstruktor für den

War es hilfreich?

Lösung

Sie sehen Sie die XML Schema . Zum Beispiel:

<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>

Also, sollten Sie dies tun:

<authentication-provider>  
  <password-encoder hash="sha-256" />  
  <jdbc-user-service data-source-ref="dataSource" />  
</authentication-provider>
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top