Skip to content

Commit a576aa4

Browse files
committed
fix: readme
1 parent fc61d4a commit a576aa4

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public class Example {
208208
.authorizationModelId(System.getenv("FGA_MODEL_ID")) // Optional, can be overridden per request
209209
.credentials(new Credentials(
210210
new ClientCredentials()
211-
.apiTokenIssuer(System.getenv("FGA_API_TOKEN_ISSUER"))
211+
.apiTokenIssuer(System.getenv("FGA_API_TOKEN_ISSUER")) // Full token endpoint URL, e.g. "https://mycompany.us.auth0.com/oauth/token"
212212
.apiAudience(System.getenv("FGA_API_AUDIENCE"))
213213
.clientId(System.getenv("FGA_CLIENT_ID"))
214214
.clientSecret(System.getenv("FGA_CLIENT_SECRET"))
@@ -220,7 +220,9 @@ public class Example {
220220
}
221221
```
222222

223-
#### Oauth2 Credentials
223+
#### OAuth2 Client Credentials
224+
225+
The SDK supports standard OAuth2 client credentials flow for any OAuth2-compliant provider (e.g. Keycloak, Okta). The `apiAudience` parameter is optional, and an optional `scopes` parameter can be provided as a space-separated string. The `apiTokenIssuer` should be set to the full token endpoint URL of your provider.
224226

225227
```java
226228
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -238,8 +240,8 @@ public class Example {
238240
.authorizationModelId(System.getenv("FGA_MODEL_ID")) // Optional, can be overridden per request
239241
.credentials(new Credentials(
240242
new ClientCredentials()
241-
.apiTokenIssuer(System.getenv("FGA_API_TOKEN_ISSUER"))
242-
.scopes(System.getenv("FGA_API_SCOPES")) // optional space separated scopes
243+
.apiTokenIssuer(System.getenv("FGA_API_TOKEN_ISSUER")) // Full token endpoint URL, e.g. "https://mykeycloak.example.com/realms/myrealm/protocol/openid-connect/token"
244+
.scopes(System.getenv("FGA_API_SCOPES")) // Optional, space-separated scopes
243245
.clientId(System.getenv("FGA_CLIENT_ID"))
244246
.clientSecret(System.getenv("FGA_CLIENT_SECRET"))
245247
));

0 commit comments

Comments
 (0)