Skip to content

Commit 37b10ec

Browse files
committed
Basic keycloak bootstrapping
1 parent 5f8911d commit 37b10ec

File tree

4 files changed

+142
-1
lines changed

4 files changed

+142
-1
lines changed
File renamed without changes.

auth/keycloak/eoapi-users-0.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"realm" : "eoapi",
3+
"users" : [ {
4+
"id" : "59c5407b-6280-48b6-ae19-64fe593089c7",
5+
"username" : "alice",
6+
"emailVerified" : true,
7+
"createdTimestamp" : 1712037625377,
8+
"enabled" : true,
9+
"totp" : false,
10+
"credentials" : [ ],
11+
"disableableCredentialTypes" : [ ],
12+
"requiredActions" : [ ],
13+
"realmRoles" : [ "default-roles-eoapi" ],
14+
"notBefore" : 0,
15+
"groups" : [ ]
16+
}, {
17+
"id" : "ebe7613f-377e-416d-9ef5-c990c5ddbe66",
18+
"username" : "bob",
19+
"emailVerified" : true,
20+
"createdTimestamp" : 1712037633309,
21+
"enabled" : true,
22+
"totp" : false,
23+
"credentials" : [ ],
24+
"disableableCredentialTypes" : [ ],
25+
"requiredActions" : [ ],
26+
"realmRoles" : [ "default-roles-eoapi" ],
27+
"notBefore" : 0,
28+
"groups" : [ ]
29+
} ]
30+
}

auth/keycloak/stac-api._json

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
{
2+
"clientId": "stac-api",
3+
"name": "STAC FastAPI",
4+
"description": "",
5+
"rootUrl": "http://localhost:8081",
6+
"adminUrl": "http://localhost:8081",
7+
"baseUrl": "",
8+
"surrogateAuthRequired": false,
9+
"enabled": true,
10+
"alwaysDisplayInConsole": true,
11+
"clientAuthenticatorType": "client-secret",
12+
"secret": "L9xCdEwe6qyJag4oFX4Tivq4X5lY3Yb0",
13+
"redirectUris": [
14+
"http://localhost:8081/docs/oauth2-redirect"
15+
],
16+
"webOrigins": [
17+
"http://localhost:8081"
18+
],
19+
"notBefore": 0,
20+
"bearerOnly": false,
21+
"consentRequired": false,
22+
"standardFlowEnabled": true,
23+
"implicitFlowEnabled": false,
24+
"directAccessGrantsEnabled": true,
25+
"serviceAccountsEnabled": true,
26+
"authorizationServicesEnabled": true,
27+
"publicClient": false,
28+
"frontchannelLogout": true,
29+
"protocol": "openid-connect",
30+
"attributes": {
31+
"client.secret.creation.time": "1712036922",
32+
"oauth2.device.authorization.grant.enabled": "false",
33+
"use.jwks.url": "false",
34+
"backchannel.logout.revoke.offline.tokens": "false",
35+
"use.refresh.tokens": "true",
36+
"oidc.ciba.grant.enabled": "false",
37+
"client.use.lightweight.access.token.enabled": "false",
38+
"backchannel.logout.session.required": "true",
39+
"client_credentials.use_refresh_token": "false",
40+
"tls.client.certificate.bound.access.tokens": "false",
41+
"require.pushed.authorization.requests": "false",
42+
"acr.loa.map": "{}",
43+
"display.on.consent.screen": "false",
44+
"token.response.type.bearer.lower-case": "false"
45+
},
46+
"authenticationFlowBindingOverrides": {},
47+
"fullScopeAllowed": true,
48+
"nodeReRegistrationTimeout": -1,
49+
"protocolMappers": [
50+
{
51+
"name": "Client Host",
52+
"protocol": "openid-connect",
53+
"protocolMapper": "oidc-usersessionmodel-note-mapper",
54+
"consentRequired": false,
55+
"config": {
56+
"user.session.note": "clientHost",
57+
"introspection.token.claim": "true",
58+
"id.token.claim": "true",
59+
"access.token.claim": "true",
60+
"claim.name": "clientHost",
61+
"jsonType.label": "String"
62+
}
63+
},
64+
{
65+
"name": "Client ID",
66+
"protocol": "openid-connect",
67+
"protocolMapper": "oidc-usersessionmodel-note-mapper",
68+
"consentRequired": false,
69+
"config": {
70+
"user.session.note": "client_id",
71+
"introspection.token.claim": "true",
72+
"id.token.claim": "true",
73+
"access.token.claim": "true",
74+
"claim.name": "client_id",
75+
"jsonType.label": "String"
76+
}
77+
},
78+
{
79+
"name": "Client IP Address",
80+
"protocol": "openid-connect",
81+
"protocolMapper": "oidc-usersessionmodel-note-mapper",
82+
"consentRequired": false,
83+
"config": {
84+
"user.session.note": "clientAddress",
85+
"introspection.token.claim": "true",
86+
"id.token.claim": "true",
87+
"access.token.claim": "true",
88+
"claim.name": "clientAddress",
89+
"jsonType.label": "String"
90+
}
91+
}
92+
],
93+
"defaultClientScopes": [
94+
"web-origins",
95+
"acr",
96+
"profile",
97+
"roles",
98+
"email"
99+
],
100+
"optionalClientScopes": [
101+
"address",
102+
"phone",
103+
"offline_access",
104+
"microprofile-jwt"
105+
],
106+
"access": {
107+
"view": true,
108+
"configure": true,
109+
"manage": true
110+
}
111+
}

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ services:
209209
- "9990:9990"
210210
command: start-dev --import-realm
211211
volumes:
212-
- ./auth/authentication/eoapi-realm.json:/opt/keycloak/data/import/eoapi-realm.json
212+
- ./auth/keycloak:/opt/keycloak/data/import
213213

214214
networks:
215215
default:

0 commit comments

Comments
 (0)