Last active
December 11, 2015 08:29
-
-
Save pikanji/4573740 to your computer and use it in GitHub Desktop.
Sample code for blog post: http://kurotofu.sytes.net/kanji/fool/?p=914
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<beans:bean id="encoder" class="org.springframework.security.crypto.password.StandardPasswordEncoder" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<authentication-manager> | |
<authentication-provider> | |
<password-encoder ref="encoder" /> | |
<user-service> | |
<user name="hoge" password="4c17b8a334f61a4d5c0b79f11977482ea7542c0761b74ee421b9cfe620ec1a7e07357932200428f6" authorities="ROLE_USER" /> | |
</user-service> | |
</authentication-provider> | |
</authentication-manager> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { | |
System.out.println("Enter a string to encode:"); | |
Scanner scan = new Scanner(System.in); | |
String org = scan.next(); | |
System.out.println("Original String: "+ org); | |
StandardPasswordEncoder encoder = new StandardPasswordEncoder(); | |
String enc = encoder.encode(org); | |
System.out.println("Encoded String: "+ enc); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment