Skip to content

Commit a4b597e

Browse files
committed
More documentation about configuration
1 parent c12ce41 commit a4b597e

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,70 @@ authorizationEndpoint = "/custom/authorize"
7575
tokenInfoEndpoint = "/custom/tokeninfo"
7676
```
7777

78+
### In memory
79+
In memory implementations are provided to easily setup the project.
80+
81+
#### Identity
82+
On the `InMemoryIdentity` identities can be registered. These are normally your users:
83+
```kotlin
84+
identityService = InMemoryIdentity()
85+
.identity {
86+
username = "foo-1"
87+
password = "bar"
88+
}
89+
.identity {
90+
username = "foo-2"
91+
password = "bar"
92+
}
93+
```
94+
95+
#### Client
96+
On the `InMemoryClient` clients can be registered:
97+
```kotlin
98+
clientService = InMemoryClient()
99+
.client {
100+
clientId = "app1-client"
101+
clientSecret = "testpass"
102+
scopes = setOf("admin")
103+
redirectUris = setOf("https://localhost:8080/callback")
104+
authorizedGrantTypes = setOf(
105+
AuthorizedGrantType.AUTHORIZATION_CODE,
106+
AuthorizedGrantType.PASSWORD,
107+
AuthorizedGrantType.IMPLICIT,
108+
AuthorizedGrantType.REFRESH_TOKEN
109+
)
110+
}
111+
.client {
112+
clientId = "app2-client"
113+
clientSecret = "testpass"
114+
scopes = setOf("user")
115+
redirectUris = setOf("https://localhost:8080/callback")
116+
authorizedGrantTypes = setOf(
117+
AuthorizedGrantType.AUTHORIZATION_CODE
118+
)
119+
}
120+
```
121+
122+
#### Token store
123+
The `InMemoryTokenStore` stores all kinds of tokens.
124+
```kotlin
125+
tokenStore = InMemoryTokenStore()
126+
```
127+
128+
### Converters
129+
130+
#### Access token converter
131+
By default `UUIDAccessTokenConverter` is used. With a default time-out of 1 hour. To override the time-out for example to half an hour:
132+
```kotlin
133+
accessTokenConverter = UUIDAccessTokenConverter(1800)
134+
```
135+
#### Refresh token converter
136+
By default `UUIDRefreshTokenConverter` is used. With a default time-out of 1 hour. To override the time-out for example to half an hour:
137+
```kotlin
138+
refreshTokenConverter = UUIDRefreshTokenConverter(1800)
139+
```
140+
#### Code token converter
141+
By default `UUIDCodeTokenConverter` is used. With a default time-out of 5 minutes. To override the time-out for example 2 minutes:
142+
```kotlin
143+
codeTokenConverter = UUIDCodeTokenConverter(120)
144+
```

0 commit comments

Comments
 (0)