Wie wissen Sie, Parameter, welche XML ein Spring-Konfigurations Tag hat?
-
12-09-2019 - |
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
Lösung Sie sehen Sie die XML Schema . Zum Beispiel: Also, sollten Sie dies tun: <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>
<authentication-provider>
<password-encoder hash="sha-256" />
<jdbc-user-service data-source-ref="dataSource" />
</authentication-provider>