Skip to content

Commit d9fbe5c

Browse files
committed
add details to API docs
1 parent 3faeab5 commit d9fbe5c

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,24 +108,32 @@ server.route([
108108
## API
109109
#### Plugin Options
110110

111-
- `client {Object}`: The configuration of [`keycloak-auth-utils`][keycloak-auth-utils] its [`GrantManager`][keycloak-auth-utils-gm]. The configuration requires at least `realmUrl`, `clientId` and `secret` – it may be necessary to reduce `minTimeBetweenJwksRequests`.<br/>
112-
Required.
113-
114-
- `cache {Object|false}`: The configuration of the [hapi.js cache](https://hapijs.com/api#servercacheoptions) powered by [catbox][catbox].<br/>
115-
If `false` the cache is disabled. Use an empty object to use the built-in default cache.<br/>
111+
- `client {Object}` — The configuration of [`keycloak-auth-utils`][keycloak-auth-utils] its [`GrantManager`][keycloak-auth-utils-gm]. The configuration requires at least:
112+
- `realmUrl {string}`: The absolute uri of the Keycloak realm<br/>
113+
Example: `https://localhost:8080/auth/realms/testme`
114+
- `clientId {string}` The identifier of the Keycloak client<br/>
115+
Example: `foobar`
116+
- `secret {string}` The related secret of the Keycloak client<br/>
117+
Example: `1234-bar-4321-foo`
118+
119+
Furthermore it may be necessary to reduce `minTimeBetweenJwksRequests`.<br/>
120+
Required.
121+
122+
- `cache {Object|false}` — The configuration of the [hapi.js cache](https://hapijs.com/api#servercacheoptions) powered by [catbox][catbox].<br/>
123+
If `false` the cache is disabled. Use an empty object (`{}`) to use the built-in default cache.<br/>
116124
Optional. Default: `false`.
117125

118-
- `userInfo {Array.<?string>}`: List of properties which should be included in the `request.auth.credentials` object besides `scope` and `sub`.<br/>
126+
- `userInfo {Array.<?string>}` List of properties which should be included in the `request.auth.credentials` object besides `scope` and `sub`.<br/>
119127
Optional. Default: `[]`.<br/>
120128

121129
#### `server.kjwt.validate(field {string}, done {Function})`
122130
Uses internally [`GrantManager.prototype.validateAccessToken()`][keycloak-auth-utils-gm-validate].
123131

124-
- `field {string}`: The `Bearer` field, including the scheme (`bearer`) itself.<br/>
132+
- `field {string}` The `Bearer` field, including the scheme (`bearer`) itself.<br/>
125133
Example: `bearer 12345.abcde.67890`.<br/>
126134
Required.
127135

128-
- `done {Function}`: The callback handler is passed `err {Error}, result {Object|false}` (error-first approach).<br/>If an error occurs, `err` is not `null`. If the token is invalid, the `result` is `false`. Otherwise it is an object containing all relevant credentials.<br/>
136+
- `done {Function}` The callback handler is passed `err {Error}, result {Object|false}` (error-first approach).<br/>If an error occurs, `err` is not `null`. If the token is invalid, the `result` is `false`. Otherwise it is an object containing all relevant credentials.<br/>
129137
Required.
130138

131139
## Example

0 commit comments

Comments
 (0)