Skip to content

Commit ffcb691

Browse files
nsteinmetzadejanovski
authored andcommitted
Add auth with encrypted password sample
1 parent 4e26e1c commit ffcb691

File tree

1 file changed

+30
-5
lines changed

1 file changed

+30
-5
lines changed

src/docs/content/docs/usage/authentication.md

+30-5
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@ Authentication can be activated in Reaper for the web UI only. It relies on [Apa
1212

1313
To activate authentication, add the following block to your Reaper yaml file :
1414

15-
```
15+
```ini
1616
accessControl:
1717
sessionTimeout: PT10M
1818
shiro:
1919
iniConfigs: ["file:/path/to/shiro.ini"]
2020
```
2121

22+
## With clear passwords
23+
2224
Create a `shiro.ini` file and adapt it from the following sample :
2325

24-
```
26+
```ini
2527
[main]
2628
authc = org.apache.shiro.web.filter.authc.PassThruAuthenticationFilter
2729
authc.loginUrl = /webui/login.html
@@ -42,10 +44,33 @@ user2 = password2
4244
/** = anon
4345
```
4446

45-
Then start Reaper.
47+
## With encrypted passwords
48+
49+
Based on [Shiro's document on Encrypting passwords](https://shiro.apache.org/configuration.html#Configuration-EncryptingPasswords) :
50+
51+
```ini
52+
[main]
53+
authc = org.apache.shiro.web.filter.authc.PassThruAuthenticationFilter
54+
authc.loginUrl = /webui/login.html
55+
sha256Matcher = org.apache.shiro.authc.credential.Sha256CredentialsMatcher
56+
iniRealm.credentialsMatcher = $sha256Matcher
4657

47-
Both the REST API and the `/webui/login.html` pages will be accessible anonymously, but all other pages will require to be authenticated.
58+
[users]
59+
john = 807A09440428C0A8AEF58BD3ECE32938B0D76E638119E47619756F5C2C20FF3A
4860

49-
5061

62+
[urls]
63+
# Allow anonynous access to login page (and dependencies), but no other pages
64+
/webui/ = authc
65+
/webui = authc
66+
/webui/login.html = anon
67+
/webui/*.html* = authc
68+
/webui/*.js* = anon
69+
/ping = anon
70+
/login = anon
71+
/** = anon
72+
```
73+
74+
Then start Reaper.
5175

76+
Both the REST API and the `/webui/login.html` pages will be accessible anonymously, but all other pages will require to be authenticated.

0 commit comments

Comments
 (0)