diff --git a/test/e2e/profiles/oidc/.kratos.yml b/test/e2e/profiles/oidc/.kratos.yml index ed8cd9916971..b02a84cd3c73 100644 --- a/test/e2e/profiles/oidc/.kratos.yml +++ b/test/e2e/profiles/oidc/.kratos.yml @@ -8,10 +8,10 @@ selfservice: provider: generic client_id: kratos-client client_secret: kratos-secret - schema_url: file://test/e2e/profiles/oidc/hydra.schema.json issuer_url: http://127.0.0.1:4444/ scope: - offline + mapper_url: file://test/e2e/profiles/oidc/hydra.jsonnet password: enabled: true diff --git a/test/e2e/profiles/oidc/hydra.jsonnet b/test/e2e/profiles/oidc/hydra.jsonnet new file mode 100644 index 000000000000..fb11ebabe94e --- /dev/null +++ b/test/e2e/profiles/oidc/hydra.jsonnet @@ -0,0 +1,13 @@ +local claims = std.extVar('claims'); + +if std.length(claims.sub) == 0 then + error 'claim sub not set' +else + { + identity: { + traits: { + email: claims.sub, + [if "website" in claims then "website" else null]: claims.website, + }, + }, + } diff --git a/test/e2e/profiles/oidc/hydra.schema.json b/test/e2e/profiles/oidc/hydra.schema.json deleted file mode 100644 index 22e2f1961e27..000000000000 --- a/test/e2e/profiles/oidc/hydra.schema.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "$id": "http://mydomain.com/github.schema.json ", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "properties": { - "sub": { - "type": "string", - "ory.sh/kratos": { - "mappings": { - "identity": { - "traits": [ - { - "path": "email" - } - ] - } - } - } - }, - "website": { - "type": "string", - "ory.sh/kratos": { - "mappings": { - "identity": { - "traits": [ - { - "path": "website" - } - ] - } - } - } - } - }, - "required": [ - "sub" - ] -}