-
Notifications
You must be signed in to change notification settings - Fork 969
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,7 @@ selfservice: | |
log: | ||
level: debug | ||
format: text | ||
leak_sensitive_values: true | ||
|
||
secrets: | ||
cookie: | ||
|
40 changes: 40 additions & 0 deletions
40
contrib/quickstart/kratos/oidc/identity.traits.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"$id": "https://schemas.ory.sh/presets/kratos/quickstart/email-password/identity.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", | ||
"minLength": 3, | ||
"ory.sh/kratos": { | ||
"credentials": { | ||
"password": { | ||
"identifier": true | ||
} | ||
}, | ||
"verification": { | ||
"via": "email" | ||
}, | ||
"recovery": { | ||
"via": "email" | ||
} | ||
} | ||
}, | ||
"website": { | ||
"type": "object" | ||
} | ||
}, | ||
"required": [ | ||
"website", | ||
"email" | ||
], | ||
"additionalProperties": false | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
local claims = { | ||
email_verified: false | ||
} + std.extVar('claims'); | ||
|
||
{ | ||
identity: { | ||
traits: { | ||
// Allowing unverified email addresses enables account | ||
// enumeration attacks, especially if the value is used for | ||
// e.g. verification or as a password login identifier. | ||
// | ||
// Therefore we only return the email if it (a) exists and (b) is marked verified | ||
// by GitHub. | ||
[if "email" in claims && claims.email_verified then "email" else null]: claims.email, | ||
}, | ||
}, | ||
} |