You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the `external-idp` profile to integrate with external OIDC providers.
@@ -84,13 +109,17 @@ Create an OIDC client in Keycloak with the following settings:
84
109
"clientId": "exploit-iq-client",
85
110
"enabled": true,
86
111
"clientAuthenticatorType": "client-secret",
112
+
"secret": "<your-client-secret>",
87
113
"redirectUris": ["https://your-app-url/*"],
88
114
"webOrigins": ["https://your-app-url"],
89
115
"publicClient": false,
90
-
"standardFlowEnabled": true
116
+
"standardFlowEnabled": true,
117
+
"directAccessGrantsEnabled": true
91
118
}
92
119
```
93
120
121
+
**Important:** `directAccessGrantsEnabled: true` is required for API authentication via password grant.
122
+
94
123
Required protocol mappers (add to client scope):
95
124
96
125
- `preferred_username`: Maps `username` to `preferred_username` claim
@@ -149,6 +178,80 @@ The same approach works with any OIDC-compliant provider:
149
178
150
179
**Note:** GitHub does not support OIDC. Use Keycloak as an identity broker for GitHub authentication.
151
180
181
+
## API Authentication with JWT (external-idp)
182
+
183
+
When using Keycloak or other OIDC providers, you can obtain tokens via the standard OIDC token endpoint. This allows CLI tools, scripts, and external services to authenticate without browser interaction.
184
+
185
+
### Obtaining a User Token
186
+
187
+
Use the password grant to obtain a token for a specific user:
**Important:** The `scope=openid profile email` parameter is required. Without `openid`, the UserInfo endpoint will reject the token with "Missing openid scope" error.
213
+
214
+
### Making API Requests
215
+
216
+
Use the token in the `Authorization` header:
217
+
218
+
```bash
219
+
# List reports
220
+
curl -H "Authorization: Bearer $USER_TOKEN" \
221
+
http://localhost:8080/api/v1/reports
222
+
223
+
# Get specific report
224
+
curl -H "Authorization: Bearer $USER_TOKEN" \
225
+
http://localhost:8080/api/v1/reports/{id}
226
+
```
227
+
228
+
### Service-to-Service Authentication (Optional)
229
+
230
+
For machine-to-machine communication, use the client credentials grant:
# For prod deployments (OpenShift OAuth) - default
73
+
./mvnw package -Dnative
74
+
```
75
+
76
+
**Important:** The CI/CD pipeline builds a universal image without a specific profile. Runtime profile selection via `QUARKUS_PROFILE` works for most configurations, but build-time properties (like `@IfBuildProfile` annotations) are fixed at compile time.
77
+
64
78
If you want to learn more about building native executables, please consult <https://quarkus.io/guides/maven-tooling>.
0 commit comments