Skip to content

Commit

Permalink
docs: complete registration documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Sep 7, 2020
1 parent c660a04 commit b3af02b
Show file tree
Hide file tree
Showing 13 changed files with 573 additions and 25 deletions.
@@ -1,5 +1,5 @@
$ curl -s -H "Accept: application/json" \
'http://127.0.0.1:4433/self-service/login/flows?id=2e87577f-1209-407c-b523-4727d7bbdbd4' \
'http://127.0.0.1:4433/self-service/registration/flows?id=2e87577f-1209-407c-b523-4727d7bbdbd4' \
| jq -r 'methods.oidc.config'

{
Expand Down
45 changes: 28 additions & 17 deletions docs/docs/self-service/flows/code/login/samples/password.wrong.txt
@@ -1,35 +1,46 @@
$ curl -H "Accept: application/json" -s \
'http://127.0.0.1:4433/self-service/login/flows?id=e7fd5f9d-4ac4-40ba-bf39-8743f85360c5' \
'http://127.0.0.1:4433/self-service/registration/flows?id=cb264cfa-31d4-40cf-bb74-1c61abd7d298' \
| jq -r '.methods.password.config'

{
"action": "http://127.0.0.1:4433/self-service/login/methods/password?flow=e7fd5f9d-4ac4-40ba-bf39-8743f85360c5",
"action": "http://127.0.0.1:4433/self-service/registration/methods/password?flow=cb264cfa-31d4-40cf-bb74-1c61abd7d298",
"method": "POST",
"fields": [
{
"name": "identifier",
"type": "text",
"name": "csrf_token",
"type": "hidden",
"required": true,
"value": "foo@ory.sh"
"value": "SRJdmk6+47L79ydSXNQyMIvfFChL51uZ16nTYw2WntUPNu5IWKzyJt9VmOTFPe6S3e/HqcVD/98dZorkreFGRg=="
},
{
"name": "password",
"type": "password",
"required": true
"required": true,
"messages": [
{
"id": 4000005,
"text": "The password can not be used because the password has been found in at least 23597311 data breaches and must no longer be used..",
"type": "error",
"context": {
"reason": "the password has been found in at least 23597311 data breaches and must no longer be used."
}
}
]
},
{
"name": "csrf_token",
"type": "hidden",
"required": true,
"value": "G8J8PTctGsu7jx4zwed6CGefexw14Xyqi+IBeXNLPlap+0ywodiN1WsKZMTBrB670X4rK/mZPOiokmmOQYUUBw=="
}
],
"messages": [
"name": "traits.email",
"type": "text",
"value": "foo@ory.sh"
},
{
"id": 4000006,
"text": "The provided credentials are invalid, check for spelling mistakes in your password or username, email address, or phone number.",
"type": "error",
"context": {}
"name": "traits.name.first",
"type": "text",
"value": ""
},
{
"name": "traits.name.last",
"type": "text",
"value": ""
}
]
}
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 36 additions & 1 deletion docs/docs/self-service/flows/code/registration/index.js
Expand Up @@ -62,6 +62,41 @@ export const initApiFlow = {
}
}

export const getFlowMethodPasswordWithErrors = {
browser: {
label: 'Browser UI',
image: require('./images/browser-error.png').default,
alt: 'User Registration HTML Form with validation errors'
},
missing: {
label: 'Missing Email',
language: 'shell',
code: require('raw-loader!./samples/password.missing.txt').default
},
wrong: {
label: 'Password Policy Violation',
language: 'shell',
code: require('raw-loader!./samples/password.policy.txt').default
},
}

export const getFlowMethodOidcWithCompletion = {
browser: {
label: 'Browser UI',
image: require('./images/browser-oidc-invalid.png').default,
alt: 'User Registration HTML Form with missing or invalid fields when performing an OpenID Connect flow'
},
missing: {
label: 'Missing Website',
language: 'shell',
code: require('raw-loader!./samples/oidc.invalid.txt').default
},
}


export const getFlowMethodOidcWithErrors = {
missing: {
label: 'Missing ID Token',
language: 'shell',
code: require('raw-loader!./samples/oidc.missing.txt').default
},
}
@@ -0,0 +1,40 @@
curl -H "Accept: application/json" -s \
'http://127.0.0.1:4433/self-service/registration/flows?id=f71b24aa-92d4-49a7-957b-72eea1c4c39d' \
| jq -r '.methods.oidc.config'

{
"action": "http://127.0.0.1:4433/self-service/methods/oidc/auth/f71b24aa-92d4-49a7-957b-72eea1c4c39d",
"method": "POST",
"fields": [
{
"name": "csrf_token",
"type": "hidden",
"required": true,
"value": "oc9VAZ5c/nvHYkb7G/z+FSn2o5kKzylFSnje6bsSANrn6+bTiE7v7+PA+U2CFSK3f8ZwGIRrjQOAt4duG2XYSQ=="
},
{
"name": "traits.email",
"type": "text",
"value": "aeneas@ory.sh"
},
{
"name": "traits.website",
"type": "",
"messages": [
{
"id": 4000002,
"text": "Property website is missing.",
"type": "error",
"context": {
"property": "website"
}
}
]
},
{
"name": "provider",
"type": "submit",
"value": "github"
}
]
}
@@ -0,0 +1,28 @@
$ curl -s -H "Accept: application/json" \
'http://127.0.0.1:4433/self-service/login/flows?id=2e87577f-1209-407c-b523-4727d7bbdbd4' \
| jq -r 'methods.oidc.config'

{
"action": "http://127.0.0.1:4433/self-service/methods/oidc/auth/2e87577f-1209-407c-b523-4727d7bbdbd4",
"method": "POST",
"messages": [
{
"id": 4000000,
"type": "error",
"text": "Authentication failed because no id_token was returned. Please accept the \"openid\" permission and try again."
}
],
"fields": [
{
"name": "csrf_token",
"type": "hidden",
"required": true,
"value": "O0e8KWxx1zZeNEgUOxNFvV8dVMrK63MXoxU102lj9n0nXcsaDWXhPn0TiZG3Nk+nLi/pT1wjTUsHniLRKOpp3w=="
},
{
"name": "provider",
"type": "submit",
"value": "github"
}
]
}
@@ -0,0 +1,35 @@
$ curl -H "Accept: application/json" -s \
'http://127.0.0.1:4433/self-service/login/flows?id=e7fd5f9d-4ac4-40ba-bf39-8743f85360c5' \
| jq -r '.methods.password.config'

{
"action": "http://127.0.0.1:4433/self-service/login/methods/password?flow=e7fd5f9d-4ac4-40ba-bf39-8743f85360c5",
"method": "POST",
"fields": [
{
"name": "identifier",
"type": "text",
"required": true,
"value": "foo@ory.sh"
},
{
"name": "password",
"type": "password",
"required": true
},
{
"name": "csrf_token",
"type": "hidden",
"required": true,
"value": "G8J8PTctGsu7jx4zwed6CGefexw14Xyqi+IBeXNLPlap+0ywodiN1WsKZMTBrB670X4rK/mZPOiokmmOQYUUBw=="
}
],
"messages": [
{
"id": 4000006,
"text": "The provided credentials are invalid, check for spelling mistakes in your password or username, email address, or phone number.",
"type": "error",
"context": {}
}
]
}
@@ -0,0 +1,58 @@
$ curl -H "Accept: application/json" -s \
'http://127.0.0.1:4433/self-service/registration/flows?id=4187c805-3635-4a52-90ac-2e6a5ea3eaf5' \
| jq -r '.methods.password.config'

{
"action": "http://127.0.0.1:4433/self-service/registration/methods/password?flow=4187c805-3635-4a52-90ac-2e6a5ea3eaf5",
"method": "POST",
"fields": [
{
"name": "csrf_token",
"type": "hidden",
"required": true,
"value": "6PFc2kc+7Z7kAdpMrTe8TDrO9k1GyCb0sxsW3B29a5Ou1e8IUSz8CsCjZfo03mDubP4lzMhsgrJ51E9bvcqzAA=="
},
{
"name": "password",
"type": "password",
"required": true
},
{
"name": "traits.email",
"type": "text",
"value": "",
"messages": [
{
"id": 4000001,
"text": "validation failed",
"type": "error"
},
{
"id": 4000001,
"text": "\"\" is not valid \"email\"",
"type": "error"
},
{
"id": 4000001,
"text": "length must be >= 3, but got 0",
"type": "error"
},
{
"id": 4000001,
"text": "\"\" is not valid \"email\"",
"type": "error"
}
]
},
{
"name": "traits.name.first",
"type": "text",
"value": "ORY"
},
{
"name": "traits.name.last",
"type": "text",
"value": "GitHub"
}
]
}

0 comments on commit b3af02b

Please sign in to comment.