text: (window.webpackJsonp=window.webpackJsonp||[]).push([[149],{330:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return w})),n.d(t,"metadata",(function(){return y})),n.d(t,"rightToc",(function(){return j})),n.d(t,"default",(function(){return k}));var a=n(2),i=n(6),r=(n(0),n(333)),s=n(338),o=n(391),l=n(379),c=n(382),d=n(383),u=n(384),p={curl:{label:"Raw HTTP",language:"shell",code:n(980).default},js:{label:"JavaScript SDK",language:"js",code:n(981).default},go:{label:"Go SDK",language:"go",code:n(982).default}},b={curl:{label:"Raw HTTP",language:"shell",code:n(983).default},html:{label:"HTML",language:"html",code:n(984).default},jsx:{label:"ReactJS",language:"js",code:n(985).default},node:{label:"Angular",language:"html",code:n(986).default},angular:{label:"ExpressJS",language:"js",code:n(987).default}},m={curl:{label:"Raw HTTP",language:"shell",code:n(988).default},js:{label:"Node",language:"js",code:n(989).default},go:{label:"Go",language:"go",code:n(990).default}},h={browser:{label:"Browser UI",image:n(991).default,alt:"User Registration HTML Form with validation errors"},missing:{label:"Missing Email",language:"shell",code:n(992).default},wrong:{label:"Password Policy Violation",language:"shell",code:n(993).default}},f={browser:{label:"Browser UI",image:n(994).default,alt:"User Registration HTML Form with missing or invalid fields when performing an OpenID Connect flow"},missing:{label:"Missing Website",language:"shell",code:n(995).default}},g={missing:{label:"Missing ID Token",language:"shell",code:n(996).default}},v=n(392),w={id:"user-registration",title:"User Registration"},y={unversionedId:"self-service/flows/user-registration",id:"self-service/flows/user-registration",isDocsHomePage:!1,title:"User Registration",description:"import {",source:"@site/docs/self-service/flows/user-registration.mdx",slug:"/self-service/flows/user-registration",permalink:"/kratos/docs/next/self-service/flows/user-registration",editUrl:"https://github.com/ory/kratos/edit/master/docs/docs/self-service/flows/user-registration.mdx",version:"current",lastUpdatedBy:"Mike",lastUpdatedAt:1602587054,sidebar:"docs",previous:{title:"Self-Service Flows",permalink:"/kratos/docs/next/self-service"},next:{title:"User Login",permalink:"/kratos/docs/next/self-service/flows/user-login"}},j=[{value:"Initialize Registration Flow",id:"initialize-registration-flow",children:[{value:"Registration for Browser Clients",id:"registration-for-browser-clients",children:[]},{value:"Registration for API Clients",id:"registration-for-api-clients",children:[]}]},{value:"Registration Form Payloads",id:"registration-form-payloads",children:[{value:"Registration with Username/Email and password",id:"registration-with-usernameemail-and-password",children:[]},{value:"Registration with Google, Facebook, GitHub, ..., OpenID Connect / OAuth 2.0",id:"registration-with-google-facebook-github--openid-connect--oauth-20",children:[]}]},{value:"Registration Flow Form Rendering",id:"registration-flow-form-rendering",children:[]},{value:"Registration Form Validation",id:"registration-form-validation",children:[{value:"Registration with Username/Email and Password",id:"registration-with-usernameemail-and-password-1",children:[]},{value:"Registration with Google, Facebook, GitHub, ..., OpenID Connect / OAuth 2.0",id:"registration-with-google-facebook-github--openid-connect--oauth-20-1",children:[]}]},{value:"Successful Registration",id:"successful-registration",children:[{value:"Browser Clients",id:"browser-clients",children:[]},{value:"API Clients",id:"api-clients",children:[]}]},{value:"Hooks",id:"hooks",children:[]}],O={rightToc:j};function k(e){var t=e.components,n=Object(i.a)(e,["components"]);return Object(r.b)("wrapper",Object(a.a)({},O,n,{components:t,mdxType:"MDXLayout"}),Object(r.b)("div",{className:"admonition admonition-info alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"rmation")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"Please read the ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"/kratos/docs/next/self-service"}),"Self-Service Flows")," overview before\ncontinuing with this document. It is also advised to run the\n",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"/kratos/docs/next/quickstart"}),"quickstart")," locally as example URLs and payloads have\nbeen generated with it."))),Object(r.b)("p",null,"There are two Registration Flow types supported in ORY Kratos:"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"Flows where the user sits in front of the Browser (e.g. website, single page\napp, ...)"),Object(r.b)("li",{parentName:"ul"},"Flows where API interaction is required (e.g. mobile app, Smart TV, ...)")),Object(r.b)("p",null,"The Registration Flow can be summarized as the following state machine:"),Object(r.b)(s.a,{chart:'\nstateDiagram\n  s1: Flow is initialized\n  s2: Execute Before Registration Hook(s)\n  s3: User Interface renders Registration Flow Forms\n  s4: Execute After Registration Hook(s)\n  s5: Update Registration Flow with Error Context(s)\n  s6: Registration successful\n\t[*] --\x3e s1 : User clicks "Sign up"\n  s1 --\x3e s2\n  s2 --\x3e Error : A hook fails\n  s2 --\x3e s3\n  s3 --\x3e s4 : User provides valid registration data\n  s3 --\x3e s5 : User provides invalid registration data\n  s5 --\x3e s3\n  s4 --\x3e Error : A hook fails\n  s4 --\x3e s6\n  s6 --\x3e [*]\n  Error --\x3e [*]\n',mdxType:"Mermaid"}),Object(r.b)("p",null,"Currently, two registration methods are supported:"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"password")," for signing up with an email / username and password;"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"oidc")," for signing up using a social sign in provider such as Google or\nFacebook (check out the\n",Object(r.b)("a",Object(a.a)({parentName:"li"},{href:"/kratos/docs/next/guides/sign-in-with-github-google-facebook-linkedin"}),"set up guide"),").")),Object(r.b)("p",null,"Both are dis/enabled in the ORY Kratos config:"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml",metastring:'title="path/to/my/kratos/config.yml"',title:'"path/to/my/kratos/config.yml"'}),"selfservice:\n  methods:\n    password:\n      enabled: true\n    oidc:\n      enabled: true\n      # ...\n")),Object(r.b)("h2",{id:"initialize-registration-flow"},"Initialize Registration Flow"),Object(r.b)("p",null,"The first step is to initialize the Registration Flow. This allows\npre-registration hooks to run, set up Anti-CSRF tokens, and more."),Object(r.b)("h3",{id:"registration-for-browser-clients"},"Registration for Browser Clients"),Object(r.b)("p",null,"The Registration Flow for browser clients relies on HTTP redirects between ORY\nKratos, your Registration UI, and the end-user's browser:"),Object(r.b)(c.a,{flows:["registration"],success:"User created and successful HTTP 302 redirect",interactions:['"Sign up"'],mdxType:"SelfServiceBrowserFlow"}),Object(r.b)("p",null,"To initialize the Registration Flow, point the Browser to the initialization\nendpoint:"),Object(r.b)(u.a,{items:b,mdxType:"CodeTabs"}),Object(r.b)("p",null,"The server responds with a HTTP 302 redirect to the Registration UI, appending\nthe ",Object(r.b)("inlineCode",{parentName:"p"},"?flow=<flow-id>")," query paremeter (see the curl example) to the URL\nconfigured here:"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml",metastring:'title="path/to/config/kratos.yml"',title:'"path/to/config/kratos.yml"'}),"selfservice:\n  flows:\n    registration:\n      # becomes http://127.0.0.1:4455/auth/registration?flow=df607aa1-d555-4b2a-b3e4-0f5a1d2fe6f3\n      ui_url: http://127.0.0.1:4455/auth/registration\n")),Object(r.b)("h3",{id:"registration-for-api-clients"},"Registration for API Clients"),Object(r.b)(o.a,{mdxType:"ApiWarning"}),Object(r.b)("p",null,"The Registration Flow for API clients does not use HTTP Redirects and can be\nsummarized as follows:"),Object(r.b)(d.a,{flows:["registration"],success:"User created and HTTP 200 OK response",interactions:['"Sign in"'],mdxType:"SelfServiceApiFlow"}),Object(r.b)("p",null,"To initialize the API flow, the client calls the API-flow initialization\nendpoint\n(",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"/kratos/docs/next/reference/api#initialize-registration-flow-for-api-clients"}),"REST API Reference"),")\nwhich returns a JSON response:"),Object(r.b)(u.a,{items:m,mdxType:"CodeTabs"}),Object(r.b)("h2",{id:"registration-form-payloads"},"Registration Form Payloads"),Object(r.b)("p",null,"Fetching the Registration Flow\n(",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"/kratos/docs/next/reference/api#get-registration-flow"}),"REST API Reference"),") is usually\nonly required for browser clients but also works for Registration Flows\ninitializied by API clients. All you need is a valid Registration Flow ID:"),Object(r.b)(u.a,{items:p,mdxType:"CodeTabs"}),Object(r.b)("h3",{id:"registration-with-usernameemail-and-password"},"Registration with Username/Email and password"),Object(r.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"Before you start")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"Please read the\n",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"/kratos/docs/next/concepts/credentials/username-email-password"}),"Username / Email & Password Credentials Documentation"),"\nfirst."))),Object(r.b)("p",null,"When the ",Object(r.b)("inlineCode",{parentName:"p"},"password")," method is enabled, it will be part of the ",Object(r.b)("inlineCode",{parentName:"p"},"methods")," payload\nin the Registration Flow. ORY Kratos uses the Identity JSON Schema defined in\n",Object(r.b)("inlineCode",{parentName:"p"},"identity.default_schema_url")," to generate a list of form fields and add it to\nthe Registration Flow. Assuming we are using the Identity JSON Schema from the\nQuickstart"),Object(r.b)(l.a,{language:"json",link:"https://github.com/ory/kratos/blob/master/contrib/quickstart/kratos/email-password/identity.schema.json",src:"https://raw.githubusercontent.com/ory/kratos/master/contrib/quickstart/kratos/email-password/identity.schema.json",mdxType:"CodeFromRemote"}),Object(r.b)("p",null,"the response would look as such:"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell",metastring:"script",script:!0}),'$ curl -H "Accept: application/json" -s \\\n  \'http://127.0.0.1:4433/self-service/registration/flows?id=838895fb-bb05-4075-8a7e-1cd22ca42017\' | jq\n\n{\n  "id": "838895fb-bb05-4075-8a7e-1cd22ca42017",\n  "type": "browser",\n  "expires_at": "2020-09-05T08:24:36.4797386Z",\n  "issued_at": "2020-09-05T08:14:36.4797386Z",\n  "request_url": "http://127.0.0.1:4433/self-service/registration/browser",\n  "methods": {\n    "password": {\n      "method": "password",\n      "config": {\n        "action": "http://127.0.0.1:4433/self-service/registration/methods/password?flow=838895fb-bb05-4075-8a7e-1cd22ca42017",\n        "method": "POST",\n        "fields": [\n          {\n            "name": "csrf_token",\n            "type": "hidden",\n            "required": true,\n            "value": "GTZrak1TBiIfyyaFajmrp/A6dS4Gh3NpMPzQjJ9ChSS7d4ODojfibHcfgNTX/9ivwci/V1K6GuRY/f4b545NUA=="\n          },\n          {\n            "name": "password",\n            "type": "password",\n            "required": true\n          },\n          {\n            "name": "traits.email",\n            "type": "email"\n          },\n          {\n            "name": "traits.name.first",\n            "type": "text"\n          },\n          {\n            "name": "traits.name.last",\n            "type": "text"\n          }\n        ]\n      }\n    }\n  }\n}\n')),Object(r.b)("h3",{id:"registration-with-google-facebook-github--openid-connect--oauth-20"},"Registration with Google, Facebook, GitHub, ..., OpenID Connect / OAuth 2.0"),Object(r.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"Before you start")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"Check out the\n",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"/kratos/docs/next/guides/sign-in-with-github-google-facebook-linkedin"}),"Sign in with GitHub, Google, ... Guide"),"\nand learn how to set up this method!"))),Object(r.b)("p",null,"The Social Sign Up Method (",Object(r.b)("inlineCode",{parentName:"p"},"oidc"),") enables you to use"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("a",Object(a.a)({parentName:"li"},{href:"http://github.com/"}),"GitHub"),";"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("a",Object(a.a)({parentName:"li"},{href:"https://developer.apple.com/sign-in-with-apple/"}),"Apple"),";"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("a",Object(a.a)({parentName:"li"},{href:"https://docs.gitlab.com/ee/integration/openid_connect_provider.html"}),"GitLab"),";"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("a",Object(a.a)({parentName:"li"},{href:"https://developers.google.com/identity/sign-in/web/sign-in"}),"Google"),";"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("a",Object(a.a)({parentName:"li"},{href:"https://developers.facebook.com/docs/facebook-login/"}),"Facebook"),";"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("a",Object(a.a)({parentName:"li"},{href:"https://www.ory.sh/hydra"}),"ORY Hydra"),";"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("a",Object(a.a)({parentName:"li"},{href:"https://www.keycloak.org"}),"Keycloak"),";"),Object(r.b)("li",{parentName:"ul"},"and every other OpenID Connect Certified Provider")),Object(r.b)("div",{className:"admonition admonition-warning alert alert--danger"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})))),"warning")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"Social Sign Up is currently not possible for API Clients. It will be possible in\na future version, which is partially tracked as\n",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://github.com/ory/kratos/issues/273"}),"kratos#273")))),Object(r.b)("p",null,"If enabled, the method contains an ",Object(r.b)("inlineCode",{parentName:"p"},"oidc")," key with the configured sign in\nproviders as submit fields:"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell",metastring:"script",script:!0}),'$ curl -H "Accept: application/json" -s \\\n  \'http://127.0.0.1:4433/self-service/registration/flows?id=838895fb-bb05-4075-8a7e-1cd22ca42017\' | jq\n\n{\n  "id": "838895fb-bb05-4075-8a7e-1cd22ca42017",\n  "type": "browser",\n  "expires_at": "2020-09-05T08:24:36.4797386Z",\n  "issued_at": "2020-09-05T08:14:36.4797386Z",\n  "request_url": "http://127.0.0.1:4433/self-service/registration/browser",\n  "methods": {\n    "oidc": {\n      "method": "oidc",\n      "config": {\n        "action": "http://127.0.0.1:4433/self-service/methods/oidc/auth/838895fb-bb05-4075-8a7e-1cd22ca42017",\n        "method": "POST",\n        "fields": [\n          {\n            "name": "csrf_token",\n            "type": "hidden",\n            "required": true,\n            "value": "GTZrak1TBiIfyyaFajmrp/A6dS4Gh3NpMPzQjJ9ChSS7d4ODojfibHcfgNTX/9ivwci/V1K6GuRY/f4b545NUA=="\n          },\n          {\n            "name": "provider",\n            "type": "submit",\n            "value": "github"\n          }\n        ]\n      }\n    }\n  }\n}\n')),Object(r.b)("h2",{id:"registration-flow-form-rendering"},"Registration Flow Form Rendering"),Object(r.b)("p",null,"The Registration User Interface is a route (page / site) in your application\n(server, native app, single page app) that should render a registration form."),Object(r.b)("p",null,"In stark contrast to other Identity Systems, ORY Kratos does not render this\nHTML. Instead, you need to implement the HTML code in your application (e.g.\nNodeJS + ExpressJS, Java, PHP, ReactJS, ...), which gives you extreme\nflexibility and customizability in your user interface flows and designs."),Object(r.b)("p",null,"You will use the Registration Flow JSON response to render the registration form\nUI, which could looks as follows depending on your programming language and web\nframework:"),Object(r.b)(v.a,{flow:"registration",mdxType:"RenderFlow"}),Object(r.b)("h2",{id:"registration-form-validation"},"Registration Form Validation"),Object(r.b)("p",null,"The form payloads are then submitted to ORY Kratos which follows up with:"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"An HTTP 302 Found redirect pointing to the Registration UI for Browser\nClients."),Object(r.b)("li",{parentName:"ul"},"An ",Object(r.b)("inlineCode",{parentName:"li"},"application/json")," response for API Clients.")),Object(r.b)("h3",{id:"registration-with-usernameemail-and-password-1"},"Registration with Username/Email and Password"),Object(r.b)("p",null,"To complete the registration process, the end-user fills out the form which must\ninclude a field marked as the identifier\n(",Object(r.b)("inlineCode",{parentName:"p"},"ory.sh/kratos.credentials.password.identifier: true"),") in the Identity JSON\nSchema, for example:"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-diff"}),' {\n   "$id": "https://schemas.ory.sh/presets/kratos/quickstart/email-password/identity.schema.json",\n   "$schema": "http://json-schema.org/draft-07/schema#",\n   "title": "Person",\n   "type": "object",\n   "properties": {\n     "traits": {\n       "type": "object",\n       "properties": {\n         "email": {\n           "type": "string",\n           "format": "email",\n+          "ory.sh/kratos": {\n+            "credentials": {\n+              "password": {\n+                "identifier": true\n+              }\n+            }\n+          }\n         }\n       },\n       "required": [\n         "email"\n       ],\n       "additionalProperties": false\n     }\n   }\n }\n')),Object(r.b)("p",null,"If the registration payload is invalid (e.g. the password does not match the\npassword policy, the email is missing, ...), the password method includes the\nvalidation errors:"),Object(r.b)(u.a,{items:h,mdxType:"CodeTabs"}),Object(r.b)("p",null,"When validation errors happen, browser clients receive a HTTP 302 Found redirect\nto the Registration Flow UI, containing the Registration Flow ID which includes\nthe error payloads."),Object(r.b)("p",null,"For API Clients, the server typically responds with HTTP 400 Bad Request and the\nRegistration Flow in the response payload as JSON."),Object(r.b)("h3",{id:"registration-with-google-facebook-github--openid-connect--oauth-20-1"},"Registration with Google, Facebook, GitHub, ..., OpenID Connect / OAuth 2.0"),Object(r.b)("p",null,"Completing the ",Object(r.b)("inlineCode",{parentName:"p"},"oidc")," method requires the user to go through an OAuth 2.0 or\nOpenID Connect flow which involves logging into the upstream identity provider\n(e.g. Google) and giving consent."),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"note")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"If the user has already sign up with the given provider before, the user will\nsimply be logged in and no new ORY Kratos Identity will be created."))),Object(r.b)("p",null,"A possible validation error is a missing ID Token:"),Object(r.b)(u.a,{items:g,mdxType:"CodeTabs"}),Object(r.b)("p",null,"What may also happen is that the ORY Kratos Identity Schema JSON includes a\nfield which is required but was not provided by the upstream identity provider\n(e.g. Google). In those cases, the end-user's browser is returned to the\nregistration screen with the form validation errors."),Object(r.b)("p",null,"Let's assume the ORY Kratos Identity Schema JSON requires a ",Object(r.b)("inlineCode",{parentName:"p"},"website")," trait"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-diff"}),' {\n   "$id": "https://schemas.ory.sh/presets/kratos/quickstart/email-password/identity.schema.json",\n   "$schema": "http://json-schema.org/draft-07/schema#",\n   "title": "Person",\n   "type": "object",\n   "properties": {\n     "traits": {\n       "type": "object",\n       "properties": {\n         "email": {\n           "type": "string",\n           "format": "email",\n           "ory.sh/kratos": {\n             "credentials": {\n               "password": {\n                 "identifier": true\n               }\n             }\n           }\n         },\n+        "website": {\n+          "type": "string"\n+        }\n       },\n       "required": [\n         "email",\n+        "website"\n       ],\n       "additionalProperties": false\n     }\n   }\n }\n')),Object(r.b)("p",null,'which was not provided by the upstream identity provider. This can happen when\nthe user refuses to accept a certain scope (e.g. "Allow ORY Kratos access to my\nwebsite") or if the provider simply does not have this data (e.g. the upstream\nidentity provider does not collect the user\'s website).'),Object(r.b)("p",null,"In that case the end-user ends up at the registration screen and is prompted to\nprovide the missing or invalid fields:"),Object(r.b)(u.a,{items:f,mdxType:"CodeTabs"}),Object(r.b)("h2",{id:"successful-registration"},"Successful Registration"),Object(r.b)("p",null,"Completing the registration behaves differently for Browser and API Clients. The\nRegistration Flow does not issue a ORY Kratos Login Session automatically which\nprevents Account Enumeration Attacks. If these types of attacks are not your\nconcern, you can add the session hook which will issue a session after\nsuccessful registration:"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml",metastring:'title="path/to/my/config/kratos.yml"',title:'"path/to/my/config/kratos.yml"'}),"# $ kratos -c path/to/my/config/kratos.yml serve\nselfservice:\n  flows:\n    registration:\n      after:\n        password:\n          hooks:\n            - hook: session\n        oidc:\n          hooks:\n            - hook: session # Always enable this for oidc flows or the user experience suffers significantly!\n")),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"important")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},'It is very important to add the "session" hook to the after ',Object(r.b)("inlineCode",{parentName:"p"},"oidc")," registration\nhooks. Otherwise your users need to use the login flow again to be able to get a\nsession. Account Enumeration Attacks with OpenID Connect sign in flows are\ntypically not an issue if you follow the guidelines in the\n",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"../../guides/sign-in-with-github-google-facebook-linkedin"}),"Sign in with GitHub, Google, Facebook, LinkedIn, Microsoft ... Guide"),"!"))),Object(r.b)("h3",{id:"browser-clients"},"Browser Clients"),Object(r.b)("p",null,"When the registration is completed successfully, ORY Kratos responds with a HTTP\n302 Redirect to the\n",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"../../concepts/browser-redirect-flow-completion"}),"configured redirect URL"),"."),Object(r.b)("h4",{id:"with-auto-login-on-registration"},"With Auto-Login on Registration"),Object(r.b)("p",null,"If the ",Object(r.b)("inlineCode",{parentName:"p"},"session")," after hook is enabled, a ",Object(r.b)("inlineCode",{parentName:"p"},"Set-Cookie")," HTTP Header is set\nalongside the HTTP 302 redirect which contains the ORY Kratos Login Session\nCookie:"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{}),"HTTP/1.1 302 Found\nCache-Control: 0\nLocation: http://127.0.0.1:4455/\nSet-Cookie: csrf_token=b8OebRPTPr5ow23mA5gIZmFNLeuMbv8pZz1jT1Ex7ys=; Path=/; Domain=127.0.0.1; Max-Age=31536000; HttpOnly\nSet-Cookie: ory_kratos_session=MTU5OTE2ODc2N3xEdi1CQkFFQ180SUFBUkFCRUFBQVJfLUNBQUVHYzNSeWFXNW5EQThBRFhObGMzTnBiMjVmZEc5clpXNEdjM1J5YVc1bkRDSUFJR055VlROMGRteHhSakJrUzBkbmRUUjBlVFY1V0RCRWFVTnJXVmR6V25oaHx2DICsB6IMbaHSQwnYITUZqr7Qx7CxUlnaneJWH495wQ==; Path=/; Expires=Fri, 04 Sep 2020 21:32:47 GMT; Max-Age=86400; HttpOnly; SameSite=Lax\nVary: Cookie\nDate: Thu, 03 Sep 2020 21:32:47 GMT\nContent-Length: 0\n")),Object(r.b)("p",null,"Now, whenever the browser is making a request (with cookies) to the\n",Object(r.b)("inlineCode",{parentName:"p"},"http://127.0.0.1/sessions/whoami")," endpoint, the session will be returned:"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell",metastring:"script",script:!0}),'curl -s -H "Cookie: ory_kratos_session=MTU5OTE2ODc2N3xEdi1CQkFFQ180SUFBUkFCRUFBQVJfLUNBQUVHYzNSeWFXNW5EQThBRFhObGMzTnBiMjVmZEc5clpXNEdjM1J5YVc1bkRDSUFJR055VlROMGRteHhSakJrUzBkbmRUUjBlVFY1V0RCRWFVTnJXVmR6V25oaHx2DICsB6IMbaHSQwnYITUZqr7Qx7CxUlnaneJWH495wQ==" \\\n  http://127.0.0.1:4433/sessions/whoami | jq\n\n{\n  "id": "ede90ce6-2420-435a-a745-3d8ab1a9636c",\n  "active": true,\n  "expires_at": "2020-09-04T21:32:47.5642404Z",\n  "authenticated_at": "2020-09-03T21:32:47.5881038Z",\n  "issued_at": "2020-09-03T21:32:47.5642688Z",\n  "identity": {\n    "id": "d96e86d9-bc33-4aa5-b865-4ade8a3974b3",\n    "schema_id": "default",\n    "schema_url": "http://127.0.0.1:4433/schemas/default",\n    "traits": {\n      "email": "foouser@ory.sh",\n      "name": {\n        "first": "foo",\n        "last": "user"\n      }\n    },\n    "verifiable_addresses": [\n      {\n        "id": "81bbdeae-6333-42f2-877e-26c78acb6ea5",\n        "value": "foouser@ory.sh",\n        "verified": false,\n        "via": "email",\n        "status": "pending",\n        "verified_at": null\n      }\n    ],\n    "recovery_addresses": [\n      {\n        "id": "596c1db4-ccaa-4f4e-9623-cb7e768026ad",\n        "value": "foouser@ory.sh",\n        "via": "email"\n      }\n    ]\n  }\n}\n')),Object(r.b)("h3",{id:"api-clients"},"API Clients"),Object(r.b)("p",null,"For API Clients, ORY Kratos responds with a JSON payload which includes the\nsigned up identity:"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell",metastring:"script",script:!0}),'# Inits a Registration Flow\n$ actionUrl=$(\\\n  curl -s -X GET -H "Accept: application/json" \\\n    "http://127.0.0.1:4433/self-service/registration/api" \\\n    | jq -r \'.methods.password.config.action\'\\\n)\n\n# Complete Registration Flow with password method\n$ curl -s -X POST -H  "Accept: application/json" -H "Content-Type: application/json" \\\n    -d \'{"traits.email": "registration-api@user.org", "password": "fhAzi860a"}\' \\\n    "$actionUrl" | jq\n\n{\n  "identity": {\n    "id": "d8baf63b-7ce6-4275-82b9-9ac6d97e5037",\n    "schema_id": "default",\n    "schema_url": "http://127.0.0.1:4433/schemas/default",\n    "traits": {\n      "email": "registration-api@user.org"\n    },\n    "verifiable_addresses": [\n      {\n        "id": "87defb49-ad69-461c-b5f6-56c1ec39dd39",\n        "value": "registration-api@user.org",\n        "verified": false,\n        "via": "email",\n        "status": "pending",\n        "verified_at": null\n      }\n    ],\n    "recovery_addresses": [\n      {\n        "id": "232793b8-8d60-427d-89e6-d0a97a7a172c",\n        "value": "registration-api@user.org",\n        "via": "email"\n      }\n    ]\n  }\n}\n')),Object(r.b)("h4",{id:"with-auto-login-on-registration-1"},"With Auto-Login on Registration"),Object(r.b)("p",null,"If the ",Object(r.b)("inlineCode",{parentName:"p"},"session")," after hook is enabled, the ORY Kratos Login Session and ORY\nKratos Login Session Token are included in the response:"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell",metastring:"script",script:!0}),'$ actionUrl=$(\\\n  curl -s -X GET -H "Accept: application/json" \\\n    "http://127.0.0.1:4433/self-service/registration/api" \\\n    | jq -r \'.methods.password.config.action\'\\\n)\n\n$ curl -s -X POST -H  "Accept: application/json" -H "Content-Type: application/json" \\\n  -d \'{"traits.email": "registration-session-api@user.org", "password": "fhAzi860a"}\' \\\n  "$actionUrl" | jq\n\n{\n  "session_token": "9kmrgslvw8ZCyEtSZqOmxEtnfBJIvB31",\n  "session": {\n    "id": "6d5ef6f4-ea54-4310-a762-473499835a48",\n    "active": true,\n    "expires_at": "2020-09-08T10:12:34.792802227Z",\n    "authenticated_at": "2020-09-07T10:12:34.797538934Z",\n    "issued_at": "2020-09-07T10:12:34.792813032Z",\n    "identity": {\n      "id": "8a7755df-1aac-4477-a53c-3f16fa059113",\n      "schema_id": "default",\n      "schema_url": "http://127.0.0.1:4433/schemas/default",\n      "traits": {\n        "email": "registration-session-api@user.org"\n      },\n      "verifiable_addresses": [\n        {\n          "id": "95139fe8-3360-4b08-adf6-4cc9b4555d86",\n          "value": "registration-session-api@user.org",\n          "verified": false,\n          "via": "email",\n          "status": "pending",\n          "verified_at": null\n        }\n      ],\n      "recovery_addresses": [\n        {\n          "id": "e6987729-b6fa-48d5-aa15-c0a57edfdfc4",\n          "value": "registration-session-api@user.org",\n          "via": "email"\n        }\n      ]\n    }\n  },\n  "identity": {\n    "id": "8a7755df-1aac-4477-a53c-3f16fa059113",\n    "schema_id": "default",\n    "schema_url": "http://127.0.0.1:4433/schemas/default",\n    "traits": {\n      "email": "registration-session-api@user.org"\n    },\n    "verifiable_addresses": [\n      {\n        "id": "95139fe8-3360-4b08-adf6-4cc9b4555d86",\n        "value": "registration-session-api@user.org",\n        "verified": false,\n        "via": "email",\n        "status": "pending",\n        "verified_at": null\n      }\n    ],\n    "recovery_addresses": [\n      {\n        "id": "e6987729-b6fa-48d5-aa15-c0a57edfdfc4",\n        "value": "registration-session-api@user.org",\n        "via": "email"\n      }\n    ]\n  }\n}\n')),Object(r.b)("h2",{id:"hooks"},"Hooks"),Object(r.b)("p",null,"ORY Kratos allows you to configure hooks that run before and after a\nRegistration Flow. This may be helpful if you'd like to restrict registration to\nIPs coming from your internal network or other logic."),Object(r.b)("p",null,"For more information about hooks please read the\n",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"/kratos/docs/next/self-service/hooks"}),"Hook Documentation"),"."))}k.isMDXComponent=!0},334:function(e,t,n){"use strict";var a=n(0),i=n(19);t.a=function(){var e=Object(a.useContext)(i.a);if(null===e)throw new Error("Docusaurus context not provided");return e}},338:function(e,t,n){"use strict";var a=n(0),i=n.n(a),r=n(355),s=n.n(r),o=n(48),l=n.n(o),c=n(347),d=n.n(c);s.a.initialize({startOnLoad:!0,logLevel:"fatal",securityLevel:"strict",arrowMarkerAbsolute:!1,theme:"neutral",flowchart:{useMaxWidth:!0,htmlLabels:!0,rankSpacing:65,nodeSpacing:30,curve:"basis"},sequence:{useMaxWidth:!0},gantt:{useMaxWidth:!0}});t.a=function(e){var t,n=e.chart,r=Object(a.useState)(!1),o=r[0],c=r[1],u=Object(a.useState)(void 0),p=u[0],b=u[1],m=Object(a.useState)("mermaid-"+Math.random().toString(36).substr(2,-1))[0],h=function(){return c(!o)};return Object(a.useEffect)((function(){s.a.render(m,n,(function(e){b(e)}))}),[]),i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{onClick:h,className:d()(l.a.graph,l.a.pointer),dangerouslySetInnerHTML:{__html:p}}),i.a.createElement("div",{onClick:h,className:d()(l.a.overlay,l.a.pointer,l.a.graph,(t={},t[l.a.visible]=o,t))},i.a.createElement("div",{onClick:function(e){return e.stopPropagation()},className:d()(l.a.backdrop,l.a.graph),dangerouslySetInnerHTML:{__html:p}})))}},339:function(e,t,n){"use strict";function a(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=a(e[t]))&&(i&&(i+=" "),i+=n);else for(t in e)e[t]&&(i&&(i+=" "),i+=t);return i}t.a=function(){for(var e,t,n=0,i="";n<arguments.length;)(e=arguments[n++])&&(t=a(e))&&(i&&(i+=" "),i+=t);return i}},342:function(e,t,n){"use strict";var a=n(0),i=n.n(a),r=n(345),s=n(339),o=n(49),l=n.n(o),c=37,d=39;t.a=function(e){var t=e.block,n=e.children,o=e.defaultValue,u=e.values,p=e.groupId,b=Object(r.a)(),m=b.tabGroupChoices,h=b.setTabGroupChoices,f=Object(a.useState)(o),g=f[0],v=f[1],w=Object(a.useState)(!1),y=w[0],j=w[1];if(null!=p){var O=m[p];null!=O&&O!==g&&u.some((function(e){return e.value===O}))&&v(O)}var k=function(e){v(e),null!=p&&h(p,e)},N=[],T=function(e){e.metaKey||e.altKey||e.ctrlKey||j(!0)},x=function(){j(!1)};return Object(a.useEffect)((function(){window.addEventListener("keydown",T),window.addEventListener("mousedown",x)}),[]),i.a.createElement("div",null,i.a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:Object(s.a)("tabs",{"tabs--block":t})},u.map((function(e){var t=e.value,n=e.label;return i.a.createElement("li",{role:"tab",tabIndex:0,"aria-selected":g===t,className:Object(s.a)("tabs__item",l.a.tabItem,{"tabs__item--active":g===t}),style:y?{}:{outline:"none"},key:t,ref:function(e){return N.push(e)},onKeyDown:function(e){!function(e,t,n){switch(n.keyCode){case d:!function(e,t){var n=e.indexOf(t)+1;e[n]?e[n].focus():e[0].focus()}(e,t);break;case c:!function(e,t){var n=e.indexOf(t)-1;e[n]?e[n].focus():e[e.length-1].focus()}(e,t)}}(N,e.target,e),T(e)},onFocus:function(){return k(t)},onClick:function(){k(t),j(!1)},onPointerDown:function(){return j(!1)}},n)}))),i.a.createElement("div",{role:"tabpanel",className:"margin-vert--md"},a.Children.toArray(n).filter((function(e){return e.props.value===g}))[0]))}},343:function(e,t,n){"use strict";var a=n(0),i=n.n(a);t.a=function(e){return i.a.createElement("div",null,e.children)}},344:function(e,t,n){"use strict";var a=n(0),i=Object(a.createContext)(void 0);t.a=i},345:function(e,t,n){"use strict";var a=n(0),i=n(344);t.a=function(){var e=Object(a.useContext)(i.a);if(null==e)throw new Error("`useUserPreferencesContext` is used outside of `Layout` Component.");return e}},348:function(e,t,n){"use strict";var a=n(2),i=n(0),r=n.n(i),s=n(339),o={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","at-rule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},l={Prism:n(20).a,theme:o};function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}var u=/\r\n|\r|\n/,p=function(e){0===e.length?e.push({types:["plain"],content:"",empty:!0}):1===e.length&&""===e[0].content&&(e[0].empty=!0)},b=function(e,t){var n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},m=function(e,t){var n=e.plain,a=Object.create(null),i=e.styles.reduce((function(e,n){var a=n.languages,i=n.style;return a&&!a.includes(t)||n.types.forEach((function(t){var n=d({},e[t],i);e[t]=n})),e}),a);return i.root=n,i.plain=d({},n,{backgroundColor:null}),i};function h(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&-1===t.indexOf(a)&&(n[a]=e[a]);return n}var f=function(e){function t(){for(var t=this,n=[],a=arguments.length;a--;)n[a]=arguments[a];e.apply(this,n),c(this,"getThemeDict",(function(e){if(void 0!==t.themeDict&&e.theme===t.prevTheme&&e.language===t.prevLanguage)return t.themeDict;t.prevTheme=e.theme,t.prevLanguage=e.language;var n=e.theme?m(e.theme,e.language):void 0;return t.themeDict=n})),c(this,"getLineProps",(function(e){var n=e.key,a=e.className,i=e.style,r=d({},h(e,["key","className","style","line"]),{className:"token-line",style:void 0,key:void 0}),s=t.getThemeDict(t.props);return void 0!==s&&(r.style=s.plain),void 0!==i&&(r.style=void 0!==r.style?d({},r.style,i):i),void 0!==n&&(r.key=n),a&&(r.className+=" "+a),r})),c(this,"getStyleForToken",(function(e){var n=e.types,a=e.empty,i=n.length,r=t.getThemeDict(t.props);if(void 0!==r){if(1===i&&"plain"===n[0])return a?{display:"inline-block"}:void 0;if(1===i&&!a)return r[n[0]];var s=a?{display:"inline-block"}:{},o=n.map((function(e){return r[e]}));return Object.assign.apply(Object,[s].concat(o))}})),c(this,"getTokenProps",(function(e){var n=e.key,a=e.className,i=e.style,r=e.token,s=d({},h(e,["key","className","style","token"]),{className:"token "+r.types.join(" "),children:r.content,style:t.getStyleForToken(r),key:void 0});return void 0!==i&&(s.style=void 0!==s.style?d({},s.style,i):i),void 0!==n&&(s.key=n),a&&(s.className+=" "+a),s}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.render=function(){var e=this.props,t=e.Prism,n=e.language,a=e.code,i=e.children,r=this.getThemeDict(this.props),s=t.languages[n];return i({tokens:function(e){for(var t=[[]],n=[e],a=[0],i=[e.length],r=0,s=0,o=[],l=[o];s>-1;){for(;(r=a[s]++)<i[s];){var c=void 0,d=t[s],m=n[s][r];if("string"==typeof m?(d=s>0?d:["plain"],c=m):(d=b(d,m.type),m.alias&&(d=b(d,m.alias)),c=m.content),"string"==typeof c){var h=c.split(u),f=h.length;o.push({types:d,content:h[0]});for(var g=1;g<f;g++)p(o),l.push(o=[]),o.push({types:d,content:h[g]})}else s++,t.push(d),n.push(c),a.push(0),i.push(c.length)}s--,t.pop(),n.pop(),a.pop(),i.pop()}return p(o),l}(void 0!==s?t.tokenize(a,s,n):[a]),className:"prism-code language-"+n,style:void 0!==r?r.root:{},getLineProps:this.getLineProps,getTokenProps:this.getTokenProps})},t}(i.Component),g=n(353),v=n.n(g),w=n(354),y=n.n(w),j=n(334),O={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},k=n(350),N=function(){var e=Object(j.a)().siteConfig.themeConfig.prism,t=void 0===e?{}:e,n=Object(k.a)().isDarkTheme,a=t.theme||O,i=t.darkTheme||a;return n?i:a},T=n(50),x=n.n(T),R=/{([\d,-]+)}/,C=function(e){void 0===e&&(e=["js","jsBlock","jsx","python","html"]);var t={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},python:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},n=["highlight-next-line","highlight-start","highlight-end"].join("|"),a=e.map((function(e){return"(?:"+t[e].start+"\\s*("+n+")\\s*"+t[e].end+")"})).join("|");return new RegExp("^\\s*(?:"+a+")\\s*$")},S=/title=".*"/;t.a=function(e){var t=e.children,n=e.className,o=e.metastring,c=Object(j.a)().siteConfig.themeConfig.prism,d=void 0===c?{}:c,u=Object(i.useState)(!1),p=u[0],b=u[1],m=Object(i.useState)(!1),h=m[0],g=m[1];Object(i.useEffect)((function(){g(!0)}),[]);var w=Object(i.useRef)(null),O=[],k="",T=N();if(o&&R.test(o)){var E=o.match(R)[1];O=y.a.parse(E).filter((function(e){return e>0}))}o&&S.test(o)&&(k=o.match(S)[0].split("title=")[1].replace(/"+/g,""));var F=n&&n.replace(/language-/,"");!F&&d.defaultLanguage&&(F=d.defaultLanguage);var P=t.replace(/\n$/,"");if(0===O.length&&void 0!==F){for(var A,H="",I=function(e){switch(e){case"js":case"javascript":case"ts":case"typescript":return C(["js","jsBlock"]);case"jsx":case"tsx":return C(["js","jsBlock","jsx"]);case"html":return C(["js","jsBlock","html"]);case"python":case"py":return C(["python"]);default:return C()}}(F),U=t.replace(/\n$/,"").split("\n"),B=0;B<U.length;){var _=B+1,M=U[B].match(I);if(null!==M){switch(M.slice(1).reduce((function(e,t){return e||t}),void 0)){case"highlight-next-line":H+=_+",";break;case"highlight-start":A=_;break;case"highlight-end":H+=A+"-"+(_-1)+","}U.splice(B,1)}else B+=1}O=y.a.parse(H),P=U.join("\n")}var K=function(){v()(P),b(!0),setTimeout((function(){return b(!1)}),2e3)};return r.a.createElement(f,Object(a.a)({},l,{key:String(h),theme:T,code:P,language:F}),(function(e){var t,n,i=e.className,o=e.style,l=e.tokens,c=e.getLineProps,d=e.getTokenProps;return r.a.createElement(r.a.Fragment,null,k&&r.a.createElement("div",{style:o,className:x.a.codeBlockTitle},k),r.a.createElement("div",{className:x.a.codeBlockContent},r.a.createElement("button",{ref:w,type:"button","aria-label":"Copy code to clipboard",className:Object(s.a)(x.a.copyButton,(t={},t[x.a.copyButtonWithTitle]=k,t)),onClick:K},p?"Copied":"Copy"),r.a.createElement("div",{tabIndex:0,className:Object(s.a)(i,x.a.codeBlock,(n={},n[x.a.codeBlockWithTitle]=k,n))},r.a.createElement("div",{className:x.a.codeBlockLines,style:o},l.map((function(e,t){1===e.length&&""===e[0].content&&(e[0].content="\n");var n=c({line:e,key:t});return O.includes(t+1)&&(n.className=n.className+" docusaurus-highlight-code-line"),r.a.createElement("div",Object(a.a)({key:t},n),e.map((function(e,t){return r.a.createElement("span",Object(a.a)({key:t},d({token:e,key:t})))})))}))))))}))}},350:function(e,t,n){"use strict";var a=n(0),i=n(351);t.a=function(){var e=Object(a.useContext)(i.a);if(null==e)throw new Error("`useThemeContext` is used outside of `Layout` Component. See https://v2.docusaurus.io/docs/theme-classic#usethemecontext.");return e}},351:function(e,t,n){"use strict";var a=n(0),i=n.n(a).a.createContext(void 0);t.a=i},353:function(e,t,n){"use strict";const a=(e,{target:t=document.body}={})=>{const n=document.createElement("textarea"),a=document.activeElement;n.value=e,n.setAttribute("readonly",""),n.style.contain="strict",n.style.position="absolute",n.style.left="-9999px",n.style.fontSize="12pt";const i=document.getSelection();let r=!1;i.rangeCount>0&&(r=i.getRangeAt(0)),t.append(n),n.select(),n.selectionStart=0,n.selectionEnd=e.length;let s=!1;try{s=document.execCommand("copy")}catch(o){}return n.remove(),r&&(i.removeAllRanges(),i.addRange(r)),a&&a.focus(),s};e.exports=a,e.exports.default=a},354:function(e,t){e.exports.parse=function(e){var t=e.split(",").map((function(e){return function(e){if(/^-?\d+$/.test(e))return parseInt(e,10);var t;if(t=e.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)){var n=t[1],a=t[2],i=t[3];if(n&&i){var r=[],s=(n=parseInt(n))<(i=parseInt(i))?1:-1;"-"!=a&&".."!=a&&"\u2025"!=a||(i+=s);for(var o=n;o!=i;o+=s)r.push(o);return r}}return[]}(e)}));return 0===t.length?[]:1===t.length?Array.isArray(t[0])?t[0]:t:t.reduce((function(e,t){return Array.isArray(e)||(e=[e]),Array.isArray(t)||(t=[t]),e.concat(t)}))}},356:function(e,t){},357:function(e,t){},358:function(e,t){},359:function(e,t){},360:function(e,t){},361:function(e,t){},362:function(e,t){},363:function(e,t){},364:function(e,t){},365:function(e,t){},366:function(e,t){},367:function(e,t){},368:function(e,t){},369:function(e,t,n){var a={"./locale":341,"./locale.js":341};function i(e){var t=r(e);return n(t)}function r(e){if(!n.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}i.keys=function(){return Object.keys(a)},i.resolve=r,e.exports=i,i.id=369},379:function(e,t,n){"use strict";var a=n(0),i=n.n(a),r=n(385),s=n.n(r),o=n(348),l=n(51),c=n.n(l);t.a=function(e){var t=e.src,n=e.link,r=e.lang,l=Object(a.useState)(""),d=l[0],u=l[1];return Object(a.useEffect)((function(){s()(t).then((function(e){return e.text()})).then(u).catch(console.err)}),[]),i.a.createElement("div",{className:c.a.container},i.a.createElement(o.a,{metastring:n&&'title="'+n+'"',className:r&&"language-"+r,children:d}))}},382:function(e,t,n){"use strict";var a=n(0),i=n.n(a),r=n(338);t.a=function(e){return i.a.createElement(i.a.Fragment,null,i.a.createElement(r.a,{chart:(t=e,n=t.flows,a=void 0===n?["login","registration","settings","..."]:n,s=t.interactions,o=void 0===s?['"Log in"','"Sign Up"','"Update Email"',"..."]:s,l=t.success,c=void 0===l?"Perform flow-specific action (e.g. create user, set session cookie, ...)":l,d=a.length>1?"<"+a.join("|")+">":""+a.join("|"),"\nsequenceDiagram\n\n  participant B as Browser\n  participant K as ORY Kratos\n  participant A as Flow UI\n\n  B->>K: Follow link to /self-service/"+d+"/browser\n  K--\x3e>K: Create and store new "+a.join(", ")+" flow\n  K->>B: HTTP 302 Found <selfservice.flows."+d+".ui_url>?flow=<flow-id>\n\n  B->>A: Opens <selfservice.flows.<"+a.join("|")+">.ui_url>?flow=<flow-id>\n  A--\x3e>K: Fetches data to render forms using /selfservice/"+d+"/flows?id=<flow-id>\n  B--\x3e>A: Fills out forms, clicks e.g. "+o.join(", ")+"\n  B->>K: Submits form\n  K--\x3e>K: Validates and processes form payloads\n\n  alt Form payload is valid\n    K->>B: "+c+"\n  else Form payload invalid\n    K--\x3e>K: Update and store flow (e.g. add form validation errors)\n    K--\x3e>B: HTTP 302 Found <selfservice.flows."+d+".ui_url>?flow=<flow-id>\n    B->>A: Opens <selfservice.flows."+d+"?flow=<flow-id>\n    A--\x3e>K: Fetches data to render form fields and errors\n    B->>K: Repeat flow with input data, submit, validate, ...\n  end\n")}),i.a.createElement("p",null,"The ",i.a.createElement("em",null,"Flow UI")," (",i.a.createElement("strong",null,"your application!"),') is responsible for rendering the actual Login and Registration HTML Forms. You can of course implement one app for rendering all the Login, Registration, ... screens, and another app (think "Service Oriented Architecture", "Micro-Services" or "Service Mesh") is responsible for rendering your Dashboards, Management Screens, and so on.'));var t,n,a,s,o,l,c,d}},383:function(e,t,n){"use strict";var a=n(0),i=n.n(a),r=n(338);t.a=function(e){return i.a.createElement(r.a,{chart:(t=e,n=t.flows,a=void 0===n?["login","registration","settings","..."]:n,s=t.methods,o=void 0===s?["password","oidc","..."]:s,l=t.interactions,c=void 0===l?['"Log in"','"Sign Up"','"Update Email"',"..."]:l,d=t.success,u=void 0===d?"Perform flow-specific action (e.g. create user, set session cookie, ...)":d,p=a.length>1?"<"+a.join("|")+">":""+a.join("|"),"\nsequenceDiagram\n  participant B as API Client\n  participant K as ORY Kratos\n\n  B->>K: REST GET /self-service/"+p+"/api\n  K--\x3e>K: Create and store new "+a.join(", ")+" flow\n  K->>B: HTTP 200 OK with flow as application/json payload\n  B--\x3e>B: Render form using e.g. Native iOS UI Elements\n  B--\x3e>B: User fills out forms, clicks e.g. "+c+"\n  B->>K: REST POST to e.g. /self-service/"+p+"/methods/<"+o.join("|")+">\n  K--\x3e>K: Validates and processes payload\n  alt Form payload is valid\n    K->>B: "+u+"\n  else Form payload invalid\n    K--\x3e>K: Update and store flow (e.g. add form validation errors)\n    K->>B: Respond with e.g. HTTP 400 Bad Request and updated flow as payload\n    B--\x3e>B: Render form and validation errors using e.g. Native iOS UI Elements\n    B--\x3e>K: Repeat flow with input data, submit, validate, ...\n  end\n")});var t,n,a,s,o,l,c,d,u,p}},384:function(e,t,n){"use strict";var a=n(342),i=n(343),r=n(0),s=n.n(r),o=n(348);t.a=function(e){var t=e.items;return s.a.createElement(a.a,{defaultValue:Object.keys(t)[0],values:Object.keys(t).map((function(e){return{label:t[e].label,value:e}}))},Object.keys(t).map((function(e){return s.a.createElement(i.a,{key:e,value:e},t[e].code?s.a.createElement(o.a,{className:"language-"+t[e].language,children:t[e].code}):s.a.createElement("img",{src:t[e].image,alt:t[e].alt}))})))}},385:function(e,t,n){"use strict";var a=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==a)return a;throw new Error("unable to locate global object")}();e.exports=t=a.fetch,a.fetch&&(t.default=a.fetch.bind(a)),t.Headers=a.Headers,t.Request=a.Request,t.Response=a.Response},391:function(e,t,n){"use strict";var a=n(0),i=n.n(a);t.a=function(){return i.a.createElement("div",{className:"admonition admonition-warning alert alert--danger"},i.a.createElement("div",{className:"admonition-heading"},i.a.createElement("h5",null,i.a.createElement("span",{className:"admonition-icon"},i.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"},i.a.createElement("path",{"fill-rule":"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"}))),"warning")),i.a.createElement("div",{className:"admonition-content"},i.a.createElement("p",null,"Never use API flows to implement Browser applications!"),i.a.createElement("p",null,"Using API flows in Single-Page-Apps as well as server-side apps opens up several potential attack vectors, including including Login and other CSRF attacks.")))}},392:function(e,t,n){"use strict";var a=n(342),i=n(343),r=n(0),s=n.n(r),o=n(379),l=n.p+"assets/images/browser-61597c2d37644d2e9a6cd62143a17d19.png",c=n.p+"assets/images/browser-3fffa4ddf3b8dbaa9171845af0b1ace3.png",d=n.p+"assets/images/browser-95c5fd81e495c104256cf0460ebd835a.png",u=n.p+"assets/images/browser-22673e53b8fd2d5b86732105f965b818.png";t.a=function(e){var t,n,r=e.flow;switch(r){case"registration":t=s.a.createElement("img",{src:d,alt:"User Registration HTML Form"});break;case"login":t=s.a.createElement("img",{src:l,alt:"User Login HTML Form"});break;case"settings":t=s.a.createElement("img",{src:c,alt:"Profile Settings HTML Form"});break;case"recovery":t=s.a.createElement("img",{src:u,alt:"Account Recovery HTML Form"});break;case"verification":t=s.a.createElement("img",{src:u,alt:"Email Verification HTML Form"})}return s.a.createElement(a.a,{defaultValue:"browser",values:[{label:"Browser UI",value:"browser"},{label:"ExpressJS & Handlebars",value:"express"},{label:"ReactJS",value:"react"},{label:"React Native",value:"react-native"}]},s.a.createElement(i.a,{value:"browser"},t),s.a.createElement(i.a,{value:"express"},s.a.createElement(o.a,{lang:"js",link:"https://github.com/ory/kratos-selfservice-ui-node/blob/master/src/routes/"+r+".ts",src:"https://raw.githubusercontent.com/ory/kratos-selfservice-ui-node/master/src/routes/"+r+".ts"}),"The views can be rather simple, as ORY Kratos provides you with all the information you need for rendering the forms. The following examples use Handlebars and a generic form generator to render the Flow:",s.a.createElement(a.a,{defaultValue:"view",values:[{label:(n=r,n.charAt(0).toUpperCase()+n.slice(1)+" View"),value:"view"},{label:"Generic Form View",value:"generic-form"},{label:"Example Input Form Element",value:"input-form"}]},s.a.createElement(i.a,{value:"view"},s.a.createElement(o.a,{lang:"handlebars",link:"https://github.com/ory/kratos-selfservice-ui-node/blob/master/views/"+r+".hbs",src:"https://raw.githubusercontent.com/ory/kratos-selfservice-ui-node/master/views/"+r+".hbs"})),s.a.createElement(i.a,{value:"generic-form"},s.a.createElement(o.a,{lang:"handlebars",link:"https://github.com/ory/kratos-selfservice-ui-node/blob/master/views/partials/form.hbs",src:"https://raw.githubusercontent.com/ory/kratos-selfservice-ui-node/master/views/partials/form.hbs"})),s.a.createElement(i.a,{value:"input-form"},s.a.createElement(o.a,{lang:"handlebars",link:"https://github.com/ory/kratos-selfservice-ui-node/blob/master/views/partials/form_input_default.hbs",src:"https://raw.githubusercontent.com/ory/kratos-selfservice-ui-node/master/views/partials/form_input_default.hbs"}))),"The rest of the form partials can be found"," ",s.a.createElement("a",{href:"https://github.com/ory/kratos-selfservice-ui-node/tree/master/views/partials"},"here"),"."),s.a.createElement(i.a,{value:"react"},"A React example is currently in the making."),s.a.createElement(i.a,{value:"react-native"},"A React Native example is currently in the making."))}},980:function(e,t,n){"use strict";n.r(t),t.default='$ curl -H "Accept: application/json" -s\n  \'http://127.0.0.1:4434/self-service/registration/flows?id=7c4260f5-55ad-470a-b1d4-e72dd011e4fe\' | jq\n\n{\n  "id": "7c4260f5-55ad-470a-b1d4-e72dd011e4fe",\n  "type": "browser",\n  "expires_at": "2020-08-24T12:01:46.0750749Z",\n  "issued_at": "2020-08-24T11:51:46.0750749Z",\n  "request_url": "http://127.0.0.1:4433/self-service/registration/browser",\n  "active": "password",\n  "methods": {\n    // password ...\n    // oidc ...\n  },\n  "forced": false\n}\n'},981:function(e,t,n){"use strict";n.r(t),t.default="import { Configuration, PublicApi } from '@oryd/kratos-client';\nconst kratos = new PublicApi(new Configuration({ basePath: 'http://127.0.0.1:4433/' }));\n\nconst flowId = '' // usually something like: req.query.flow\n\nkratos.getSelfServiceRegistrationFlow(flowId)\n  .then(({ status, data: flow, ...response }) => {\n    console.log(flow) // see the Raw HTTP tab for the payload\n  })\n"},982:function(e,t,n){"use strict";n.r(t),t.default='package samples\n\nimport (\n  "fmt"\n\n  "github.com/ory/kratos-client-go/client/public"\n  "github.com/ory/kratos-client-go/client"\n\n  "github.com/ory/kratos/internal/httpclient/client/common"\n)\n\nfunc main() {\n  c := client.NewHTTPClientWithConfig(nil,\n    &client.TransportConfig{Host: "127.0.0.1:4433", BasePath: "/", Schemes: []string{"http"}})\n\n  flowID := "" // Usually something like: res.Request.URL.Query().Get("flow")\n\n  rs, err := c.Common.GetSelfServiceRegistrationFlow(\n    common.NewGetSelfServiceRegistrationFlowParams().\n      WithID(flowID),\n  )\n\n  fmt.Printf("%+v", rs.Payload) //\n}\n'},983:function(e,t,n){"use strict";n.r(t),t.default='# Simulates a browser request\n$ curl -s -v -X GET \\\n  -H "Accept: text/html"  \\\n  http://127.0.0.1:4433/self-service/registration/browser\n\n> GET /self-service/registration/browser HTTP/1.1\n> Host: 127.0.0.1:4433\n> User-Agent: curl/7.64.1\n> Accept: text/html\n>\n< HTTP/1.1 302 Found\n< Cache-Control: 0\n< Content-Type: text/html; charset=utf-8\n< Location: http://127.0.0.1:4455/auth/registration?flow=df607aa1-d555-4b2a-b3e4-0f5a1d2fe6f3\n< Set-Cookie: csrf_token=y4Ocu6V83BapwJwbPw/pnlRHHw40DZbjq5iuDrxl0Ds=; Path=/; Domain=127.0.0.1; Max-Age=31536000; HttpOnly\n<\n<a href="http://127.0.0.1:4455/auth/registration?flow=df607aa1-d555-4b2a-b3e4-0f5a1d2fe6f3">Found</a>.\n'},984:function(e,t,n){"use strict";n.r(t),t.default='<a href="http://127.0.0.1:4433/self-service/registration/browser">Sign up</a>\n\n\x3c!-- or --\x3e\n\n<script>\n  const initRegistration = () => {\n    window.location.href = \'http://127.0.0.1:4433/self-service/registration/browser\'\n  }\n<\/script>\n\n<a onClick="initRegistration">Sign up</a>\n'},985:function(e,t,n){"use strict";n.r(t),t.default="import React from 'react'\n\nconst MyComponent = () => (\n  <a href=\"http://127.0.0.1:4433/self-service/registration/browser\">Sign up</a>\n)\n"},986:function(e,t,n){"use strict";n.r(t),t.default="express.get('/registration', function (req, res) {\n  res.redirect(302, 'http://127.0.0.1:4433/self-service/registration/browser')\n})\n"},987:function(e,t,n){"use strict";n.r(t),t.default='<a href="http://127.0.0.1:4433/self-service/registration/browser">Sign up</a>\n'},988:function(e,t,n){"use strict";n.r(t),t.default='$ curl -s -X GET \\\n  -H "Accept: application/json"  \\\n  http://127.0.0.1:4433/self-service/registration/api | jq\n\n{\n  "id": "daf9913c-9807-453b-aa01-4a740a43ca4e",\n  "type": "api",\n  "expires_at": "2020-09-05T08:16:52.043498Z",\n  "issued_at": "2020-09-05T08:06:52.043498Z",\n  "request_url": "http://127.0.0.1:4433/self-service/registration/api"\n  "methods": {\n    // password,\n    // oidc,\n    // ...\n  }\n}\n'},989:function(e,t,n){"use strict";n.r(t),t.default="import { Configuration, PublicApi } from '@oryd/kratos-client';\nconst kratos = new PublicApi(new Configuration({ basePath: 'http://127.0.0.1:4433/' }));\n\nkratos.initializeSelfServiceRegistrationViaAPIFlow()\n  .then(({ status, data: flow }) => {\n    console.log(flow) // see the Raw HTTP tab for the payload\n  })\n"},990:function(e,t,n){"use strict";n.r(t),t.default='package api\n\nimport (\n  "fmt"\n\n  "github.com/ory/kratos-client-go/client/public"\n  "github.com/ory/kratos-client-go/client"\n)\n\nfunc main() {\n  c := client.NewHTTPClientWithConfig(nil,\n    &client.TransportConfig{Host: "127.0.0.1:4433", BasePath: "/", Schemes: []string{"http"}})\n\n  rs, _ := c.Public.InitializeSelfServiceRegistrationViaAPIFlow(public.\n    NewInitializeSelfServiceRegistrationViaAPIFlowParams())\n\n  fmt.Printf("%+v", rs.Payload)\n}\n'},991:function(e,t,n){"use strict";n.r(t),t.default=n.p+"assets/images/browser-error-c055e0574b0cb30cd617f9f1d7788cd8.png"},992:function(e,t,n){"use strict";n.r(t),t.default='$ curl -H "Accept: application/json" -s \\\n  \'http://127.0.0.1:4433/self-service/registration/flows?id=4187c805-3635-4a52-90ac-2e6a5ea3eaf5\' \\\n  | jq -r \'.methods.password.config\'\n\n{\n  "action": "http://127.0.0.1:4433/self-service/registration/methods/password?flow=4187c805-3635-4a52-90ac-2e6a5ea3eaf5",\n  "method": "POST",\n  "fields": [\n    {\n      "name": "csrf_token",\n      "type": "hidden",\n      "required": true,\n      "value": "6PFc2kc+7Z7kAdpMrTe8TDrO9k1GyCb0sxsW3B29a5Ou1e8IUSz8CsCjZfo03mDubP4lzMhsgrJ51E9bvcqzAA=="\n    },\n    {\n      "name": "password",\n      "type": "password",\n      "required": true\n    },\n    {\n      "name": "traits.email",\n      "type": "text",\n      "value": "",\n      "messages": [\n        {\n          "id": 4000001,\n          "text": "validation failed",\n          "type": "error"\n        },\n        {\n          "id": 4000001,\n          "text": "\\"\\" is not valid \\"email\\"",\n          "type": "error"\n        },\n        {\n          "id": 4000001,\n          "text": "length must be >= 3, but got 0",\n          "type": "error"\n        },\n        {\n          "id": 4000001,\n          "text": "\\"\\" is not valid \\"email\\"",\n          "type": "error"\n        }\n      ]\n    },\n    {\n      "name": "traits.name.first",\n      "type": "text",\n      "value": "ORY"\n    },\n    {\n      "name": "traits.name.last",\n      "type": "text",\n      "value": "GitHub"\n    }\n  ]\n}\n'},993:function(e,t,n){"use strict";n.r(t),t.default='$ curl -H "Accept: application/json" -s \\\n  \'http://127.0.0.1:4433/self-service/registration/flows?id=6bc2f8f9-2898-41dd-836a-6f7d3915ffa7\' \\\n  | jq -r \'.methods.password.config\'\n\n{\n  "action": "http://127.0.0.1:4433/self-service/registration/methods/password?flow=6bc2f8f9-2898-41dd-836a-6f7d3915ffa7",\n  "method": "POST",\n  "fields": [\n    {\n      "name": "csrf_token",\n      "type": "hidden",\n      "required": true,\n      "value": "l8hejwA1NtpRWGq28lw7WjotmGiZg6YedrZ2WOcCp8KtAXeco6BqpyD/tTIF9bOcrEKnQnbxVhmHJsjMTDl03w=="\n    },\n    {\n      "name": "password",\n      "type": "password",\n      "required": true,\n      "messages": [\n        {\n          "id": 4000005,\n          "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..",\n          "type": "error",\n          "context": {\n            "reason": "the password has been found in at least 23597311 data breaches and must no longer be used."\n          }\n        }\n      ]\n    },\n    {\n      "name": "traits.email",\n      "type": "text",\n      "value": "foo@ory.sh"\n    },\n    {\n      "name": "traits.name.first",\n      "type": "text",\n      "value": ""\n    },\n    {\n      "name": "traits.name.last",\n      "type": "text",\n      "value": ""\n    }\n  ]\n}\n'},994:function(e,t,n){"use strict";n.r(t),t.default=n.p+"assets/images/browser-oidc-invalid-7c8f9ae2d6d492c0bcf9926dec2ffb99.png"},995:function(e,t,n){"use strict";n.r(t),t.default='$ curl -H "Accept: application/json" -s \\\n  \'http://127.0.0.1:4433/self-service/registration/flows?id=f71b24aa-92d4-49a7-957b-72eea1c4c39d\' \\\n  | jq -r \'.methods.oidc.config\'\n\n{\n  "action": "http://127.0.0.1:4433/self-service/methods/oidc/auth/f71b24aa-92d4-49a7-957b-72eea1c4c39d",\n  "method": "POST",\n  "fields": [\n    {\n      "name": "csrf_token",\n      "type": "hidden",\n      "required": true,\n      "value": "oc9VAZ5c/nvHYkb7G/z+FSn2o5kKzylFSnje6bsSANrn6+bTiE7v7+PA+U2CFSK3f8ZwGIRrjQOAt4duG2XYSQ=="\n    },\n    {\n      "name": "traits.email",\n      "type": "text",\n      "value": "aeneas@ory.sh"\n    },\n    {\n      "name": "traits.website",\n      "type": "",\n      "messages": [\n        {\n          "id": 4000002,\n          "text": "Property website is missing.",\n          "type": "error",\n          "context": {\n            "property": "website"\n          }\n        }\n      ]\n    },\n    {\n      "name": "provider",\n      "type": "submit",\n      "value": "github"\n    }\n  ]\n}\n'},996:function(e,t,n){"use strict";n.r(t),t.default='$ curl -s -H "Accept: application/json" \\\n  \'http://127.0.0.1:4433/self-service/registration/flows?id=2e87577f-1209-407c-b523-4727d7bbdbd4\' \\\n  | jq -r \'methods.oidc.config\'\n\n{\n  "action": "http://127.0.0.1:4433/self-service/methods/oidc/auth/2e87577f-1209-407c-b523-4727d7bbdbd4",\n  "method": "POST",\n  "messages": [\n    {\n      "id": 4000000,\n      "type": "error",\n      "text": "Authentication failed because no id_token was returned. Please accept the \\"openid\\" permission and try again."\n    }\n  ],\n  "fields": [\n    {\n      "name": "csrf_token",\n      "type": "hidden",\n      "required": true,\n      "value": "O0e8KWxx1zZeNEgUOxNFvV8dVMrK63MXoxU102lj9n0nXcsaDWXhPn0TiZG3Nk+nLi/pT1wjTUsHniLRKOpp3w=="\n    },\n    {\n      "name": "provider",\n      "type": "submit",\n      "value": "github"\n    }\n  ]\n}\n'}}]);