Skip to content

Commit 1edad25

Browse files
authored
Update README.md
1 parent 6bf67c1 commit 1edad25

File tree

1 file changed

+46
-4
lines changed

1 file changed

+46
-4
lines changed

README.md

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,61 @@
1-
# keycloak-sha1
2-
Add SHA1 hashing support to Keycloak.
1+
# keycloak-sha1-salted
2+
Add salted SHA1 hashing support to Keycloak. ie. you're migrating to Keycloak and need to import legacy passwords stored as SHA-1 salted hashes.
33

44
## Requirements
5-
65
- Java 11
76
- Maven 3.6
87

98
## Building
109

1110
- Run `mvn package`
12-
- It should generate a JAR archive under `./target/keycloak-sha1.jar`
11+
- JAR archive is generated in `./target/keycloak-sha1.jar`
1312

1413
## Deploying to Keycloak
1514

1615
1. Move the built JAR file to Keycloak's directory `standalone/deployments/` (on Keycloak under Docker: `/opt/jboss/keycloak/standalone/deployments`)
1716
2. Watch the `standalone/deployments/` for the file `keycloak-sha1.jar.deployed`
1817

1918
:warning: If you find instead the file `keycloak-sha1.jar.failed`, you can run the command `cat keycloak-sha1.jar.failed` to find out what went wrong with your deployment.
19+
20+
## How to use
21+
Use algorithm `sha1-salted` when importing users through JSON. Below an example with
22+
* password `123456789`
23+
* salt `qwerty` (base64-encoded: `cXdlcnR5`)
24+
25+
JSON:
26+
27+
{
28+
"realm": "master",
29+
"users": [
30+
{
31+
"username": "user1",
32+
"enabled": true,
33+
"totp": false,
34+
"emailVerified": true,
35+
"firstName": "user1",
36+
"lastName": "user1",
37+
"email": "user1@test.com",
38+
"credentials": [
39+
{
40+
"algorithm": "sha1-salted",
41+
"hashedSaltedValue": "9282d06b77e03989da6c0d86479ba73ac8691cfc",
42+
"salt": "cXdlcnR5",
43+
"hashIterations": 1,
44+
"type": "password"
45+
}
46+
],
47+
"disableableCredentialTypes": [],
48+
"requiredActions": [],
49+
"realmRoles": [
50+
"offline_access",
51+
"uma_authorization"
52+
],
53+
"clientRoles": {
54+
"account": [
55+
"manage-account",
56+
"view-profile"
57+
]
58+
}
59+
}
60+
]
61+
}

0 commit comments

Comments
 (0)