Skip to content

Commit

Permalink
autogen(docs): generate and format documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed May 6, 2020
1 parent 26a4d84 commit 1b4567b
Show file tree
Hide file tree
Showing 8 changed files with 171 additions and 122 deletions.
34 changes: 16 additions & 18 deletions docs/docs/concepts/credentials/openid-connect-oidc-oauth2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ selfservice:
strategies:
oidc:
providers:
-
id: github # The ID of the provider. DO NOT change this once this is in use.
- id: github # The ID of the provider. DO NOT change this once this is in use.

# The provider you would like to use. ORY Kratos comes with some predefined providers to make
# life easier for you, but you can always opt for the "generic" provider, which works
Expand Down Expand Up @@ -72,8 +71,9 @@ selfservice:

:::info

It is very important to add the "session" hook to the after oidc registration hooks. Otherwise your users need to
use the login flow again to be able to get a session.
It is very important to add the "session" hook to the after oidc registration
hooks. Otherwise your users need to use the login flow again to be able to get a
session.

```yaml title="path/to/my/kratos/config.yml"
# $ kratos -c path/to/my/kratos/config.yml serve
Expand All @@ -82,8 +82,7 @@ selfservice:
after:
oidc:
hooks:
-
hook: session
- hook: session
```

:::
Expand All @@ -110,19 +109,18 @@ field `traits.name` in your identity:

```json5
{
'$id': 'https://example.com/social.schema.json',
'$schema': 'http://json-schema.org/draft-07/schema#',
'type': 'object',
'properties':
{
'username':
{
'type': 'string',
'ory.sh/kratos':
{ 'mappings': { 'identity': { 'traits': [{ 'path': 'name' }] } } },
},
$id: 'https://example.com/social.schema.json',
$schema: 'http://json-schema.org/draft-07/schema#',
type: 'object',
properties: {
username: {
type: 'string',
'ory.sh/kratos': {
mappings: { identity: { traits: [{ path: 'name' }] } },
},
},
'required': ['username'],
},
required: ['username'],
}
```

Expand Down
22 changes: 13 additions & 9 deletions docs/docs/guides/sign-in-with-github.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ id: sign-in-with-github
title: Sign in with GitHub
---

In this document we will take a look at setting up "Sign in with GitHub"
using ORY Kratos.
In this document we will take a look at setting up "Sign in with GitHub" using
ORY Kratos.

Run the [Quickstart](../quickstart.mdx) with Docker Compose:

Expand All @@ -19,12 +19,16 @@ $ make quickstart
To set up "Sign in with GitHub" you must create a
[GitHub OAuth2 Client](https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/)
and set the "Authorization callback URL" to
`http://127.0.0.1:4455/.ory/kratos/public/self-service/browser/flows/registration/strategies/oidc/callback/github`. The
pattern of this URL is `http(s)://<domain-of-ory-kratos>:<public-port>/self-service/browser/flows/registration/strategies/oidc/callback/<provider-id>`.
The provider ID must point to the provider's ID set in the ORY Kratos configuration file (explained in paragraphs).
`http://127.0.0.1:4455/.ory/kratos/public/self-service/browser/flows/registration/strategies/oidc/callback/github`.
The pattern of this URL is
`http(s)://<domain-of-ory-kratos>:<public-port>/self-service/browser/flows/registration/strategies/oidc/callback/<provider-id>`.
The provider ID must point to the provider's ID set in the ORY Kratos
configuration file (explained in paragraphs).

As explained in [OpenID Connect and OAuth2 Credentails](../concepts/credentials/openid-connect-oidc-oauth2.mdx), you
must also create a JSON Schema for the provider. Save the JSON Schema in `<kratos-directory>/contrib/quickstart/kratos/email-password/github.schema.json`.
As explained in
[OpenID Connect and OAuth2 Credentails](../concepts/credentials/openid-connect-oidc-oauth2.mdx),
you must also create a JSON Schema for the provider. Save the JSON Schema in
`<kratos-directory>/contrib/quickstart/kratos/email-password/github.schema.json`.
The following schema takes take `email_primary` maps it to `traits.email`:

```json title="contrib/quickstart/kratos/email-password/github.schema.json"
Expand Down Expand Up @@ -71,5 +75,5 @@ selfservice:
- user:email
```

Next, open the login endpoint of the SecureApp and you should see the GitHub Login option!

Next, open the login endpoint of the SecureApp and you should see the GitHub
Login option!

0 comments on commit 1b4567b

Please sign in to comment.