curved-train-21046
11/21/2024, 11:49 PMcurved-train-21046
11/21/2024, 11:50 PMcurved-train-21046
11/21/2024, 11:50 PM{
"$id": "<https://schemas.ory.sh/presets/kratos/identity.email.schema.json>",
"$schema": "<http://json-schema.org/draft-07/schema#>",
"title": "Person",
"type": "object",
"properties": {
"traits": {
"type": "object",
"properties": {
"email": {
"type": "string",
"format": "email",
"title": "E-Mail",
"<http://ory.sh/kratos|ory.sh/kratos>": {
"credentials": {
"password": {
"identifier": true
},
"webauthn": {
"identifier": true
},
"totp": {
"account_name": true
},
"code": {
"identifier": true,
"via": "email"
},
"passkey": {
"display_name": true
}
},
"recovery": {
"via": "email"
},
"verification": {
"via": "email"
}
},
"maxLength": 320
},
"tenant_id": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
"title": "Tenant ID",
"description": "The primary tenant this user belongs to"
},
"roles": {
"type": "array",
"items": {
"type": "string",
"enum": [
"admin",
"user",
"superuser"
]
},
"title": "Roles",
"description": "The roles assigned to this user"
}
},
"required": [
"email"
],
"additionalProperties": false
}
}
}
curved-train-21046
11/21/2024, 11:51 PMhydra:
config:
serve:
public:
port: 4444
admin:
port: 4445
urls:
self:
issuer: <https://hydra.tunnel.threadr.ai/>
login: <https://kratos.tunnel.threadr.ai/login>
consent: <https://kratos.tunnel.threadr.ai/consent>
logout: <https://kratos.tunnel.threadr.ai/logout>
strategies:
access_token: jwt
jwt:
scope_claim: list
oauth2:
expose_internal_errors: true
allowed_top_level_claims:
- email
- tenant_id
mirror_top_level_claims: true
curved-train-21046
11/21/2024, 11:53 PMecho "<https://hydra.tunnel.threadr.ai/oauth2/auth>?\
client_id=0a6a0438-3871-4294-8f1c-bc92145cc7e4&\
response_type=code&\
scope=openid+profile+email+tenant_id&\
redirect_uri=<https://api.tunnel.threadr.ai/callback&>\
state=${STATE}"
<https://hydra.tunnel.threadr.ai/oauth2/auth?client_id=0a6a0438-3871-4294-8f1c-bc92145cc7e4&response_type=code&scope=openid+profile+email+tenant_id&redirect_uri=https://api.tunnel.threadr.ai/callback&state=f4372dc01ec903e047ec864e59604d28>
curved-train-21046
11/21/2024, 11:53 PMcurl -X POST <https://hydra.tunnel.threadr.ai/oauth2/token> \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode "grant_type=authorization_code" \
--data-urlencode "code=${CODE}" \
--data-urlencode "redirect_uri=<https://api.tunnel.threadr.ai/callback>" \
--data-urlencode "client_id=0a6a0438-3871-4294-8f1c-bc92145cc7e4" \
--data-urlencode "client_secret=f00b4r" \
--data-urlencode "scope=openid profile email tenant_id"
steep-lamp-91158
steep-lamp-91158
curved-train-21046
11/22/2024, 2:27 PMcurved-train-21046
11/22/2024, 3:16 PMcurved-train-21046
11/23/2024, 7:59 PMif (identity.metadata_admin?.tenant_id) {
session.access_token.tenant_id = identity.metadata_admin.tenant_id
session.id_token.tenant_id = identity.metadata_admin.tenant_id
}
curved-train-21046
11/24/2024, 2:26 AMcurved-train-21046
11/24/2024, 3:06 AM