Skip to content

Commit

Permalink
docs: add config debug section
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Dec 2, 2020
1 parent cebdd4a commit c53f036
Show file tree
Hide file tree
Showing 9 changed files with 374 additions and 60 deletions.
4 changes: 4 additions & 0 deletions docs/docs/concepts/consent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,13 @@ request! For more details about the implementation check the
]}>
<TabItem value="ui">
![Exemplary OAuth 2.0 Consent Screen](../images/consent-endpoint.png)
</TabItem>
<TabItem value="curl">
```shell script
$ curl \
"http://127.0.0.1:4445/oauth2/auth/requests/consent?consent_challenge=7bb518c4eec2454dbb289f5fdb4c0ee2"
Expand All @@ -167,6 +169,7 @@ examples using the ORY Hydra SDK in different languages.
</TabItem>
<TabItem value="json">


```json
{
"challenge": "f633e49d56bc40e0a876ac8242eb9891",
Expand Down Expand Up @@ -213,6 +216,7 @@ examples using the ORY Hydra SDK in different languages.
</TabItem>
</Tabs>


The way you collect the consent information from the End-User is up to you. In
most cases, you will show an HTML form similar to:

Expand Down
8 changes: 8 additions & 0 deletions docs/docs/concepts/login.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,13 @@ correct endpoint for your interactions.
]}>
<TabItem value="ui">


![OAuth 2.0 Client](../images/oauth2-consumer.png)

</TabItem>
<TabItem value="html">


```html
<a
href="https://<hydra-public>/oauth2/auth?client_id=...&response_type=...&scope=..."
Expand All @@ -94,6 +96,7 @@ correct endpoint for your interactions.
</TabItem>
<TabItem value="js">


```js
// ...
window.location.href =
Expand All @@ -103,6 +106,7 @@ window.location.href =
</TabItem>
</Tabs>


## Redirection to the Login Endpoint

The next task for ORY Hydra is to know the user of the request. To achieve that,
Expand Down Expand Up @@ -202,11 +206,13 @@ more details about the implementation check the
]}>
<TabItem value="ui">
![OAuth 2.0 Login UI Screen](../images/login-endpoint.png)
</TabItem>
<TabItem value="curl">
```
curl "http://127.0.0.1:4445/oauth2/auth/requests/login?login_challenge=7bb518c4eec2454dbb289f5fdb4c0ee2"
```
Expand All @@ -217,6 +223,7 @@ examples using the ORY Hydra SDK in different languages.
</TabItem>
<TabItem value="json">
```json
{
"challenge": "7bb518c4eec2454dbb289f5fdb4c0ee2",
Expand Down Expand Up @@ -255,6 +262,7 @@ examples using the ORY Hydra SDK in different languages.
</TabItem>
</Tabs>


The way you authenticate the End-User is up to you. In most cases, you will show
an HTML form similar to:

Expand Down
9 changes: 9 additions & 0 deletions docs/docs/debug/config.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
id: config
title: Debug Configuration
---

To debug the configuration, [set up tracing](../guides/tracing.mdx). Once set up,
all configuration keys will appear in your tracing UI:

![Jaeger Tracing UI for ORY Hydra](../images/tracing-config.png)
10 changes: 10 additions & 0 deletions docs/docs/guides/consent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ to ORY Hydra's Admin Endpoint!
]}>
<TabItem value="ui">


![OAuth2 Consent UI Screen](../images/consent-endpoint.png)

</TabItem>
<TabItem value="node">


:::note

Check out our
Expand Down Expand Up @@ -123,6 +125,7 @@ router.get('/get', csrfProtection, (req, res, next) => {
</TabItem>
<TabItem value="html">


```html
<form action="/consent" method="POST">
<input type="hidden" name="challenge" value="#{ challenge }" />
Expand Down Expand Up @@ -160,6 +163,7 @@ router.get('/get', csrfProtection, (req, res, next) => {
</TabItem>
</Tabs>


## Accepting the Consent Request

<Tabs
Expand All @@ -169,6 +173,7 @@ router.get('/get', csrfProtection, (req, res, next) => {
]}>
<TabItem value="node">


:::note

Check out our
Expand Down Expand Up @@ -216,6 +221,7 @@ hydraAdmin
</TabItem>
</Tabs>


## Rejecting the Consent Request

<Tabs
Expand All @@ -225,6 +231,7 @@ hydraAdmin
]}>
<TabItem value="node">


:::note

Check out our
Expand All @@ -250,6 +257,7 @@ hydraAdmin
</TabItem>
</Tabs>


## Complete Endpoint

<Tabs
Expand All @@ -259,6 +267,7 @@ hydraAdmin
]}>
<TabItem value="node">


:::note

Check out our
Expand Down Expand Up @@ -347,3 +356,4 @@ router.post('/consent', csrfProtection, (req, res, next) => {

</TabItem>
</Tabs>

8 changes: 8 additions & 0 deletions docs/docs/guides/login.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ to ORY Hydra's Admin Endpoint!
]}>
<TabItem value="ui">


![OAuth2 Login UI Screen](../images/login-endpoint.png)

</TabItem>
<TabItem value="node">


:::note

Check out our
Expand Down Expand Up @@ -102,6 +104,7 @@ router.get('/login', csrfProtection, (req, res, next) => {
</TabItem>
<TabItem value="html">


```html
<form action="/login" method="POST">
<input type="hidden" name="_csrf" value="{{ csrfToken }}" />
Expand All @@ -119,6 +122,7 @@ router.get('/login', csrfProtection, (req, res, next) => {
</TabItem>
</Tabs>


## Accepting the Login Request

<Tabs
Expand All @@ -128,6 +132,7 @@ router.get('/login', csrfProtection, (req, res, next) => {
]}>
<TabItem value="node">


:::note

Check out our
Expand Down Expand Up @@ -186,6 +191,7 @@ router.post('/login', csrfProtection, (req, res, next) => {
</TabItem>
</Tabs>


## Rejecting the Login Request

<Tabs
Expand All @@ -195,6 +201,7 @@ router.post('/login', csrfProtection, (req, res, next) => {
]}>
<TabItem value="node">


```typescript
// You can deny the login request at any point - for example if the system is currently undergoing maintenance
// or the user has been banned, is not allowed to use OAuth2 flows, and so on:
Expand All @@ -211,3 +218,4 @@ hydraAdmin

</TabItem>
</Tabs>

8 changes: 8 additions & 0 deletions docs/docs/guides/logout.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ to ORY Hydra's Admin Endpoint!
]}>
<TabItem value="ui">


![OAuth2 Logout UI Screen](../images/logout-endpoint.png)

</TabItem>
<TabItem value="node">


:::note

Check out our
Expand Down Expand Up @@ -94,6 +96,7 @@ router.get('/', csrfProtection, (req, res, next) => {
</TabItem>
<TabItem value="html">


```html
<form action="/logout" method="POST">
<input type="hidden" name="_csrf" value="{{ .csrfToken }}" />
Expand All @@ -106,6 +109,7 @@ router.get('/', csrfProtection, (req, res, next) => {
</TabItem>
</Tabs>


## Accepting Logout

<Tabs
Expand All @@ -115,6 +119,7 @@ router.get('/', csrfProtection, (req, res, next) => {
]}>
<TabItem value="node">


:::note

Check out our
Expand All @@ -141,6 +146,7 @@ router.post('/logout', csrfProtection, (req, res, next) => {
</TabItem>
</Tabs>


## Rejecting Logout

<Tabs
Expand All @@ -150,6 +156,7 @@ router.post('/logout', csrfProtection, (req, res, next) => {
]}>
<TabItem value="node">


:::note

Check out our
Expand All @@ -176,3 +183,4 @@ router.post('/logout', csrfProtection, (req, res, next) => {

</TabItem>
</Tabs>

Binary file added docs/docs/images/tracing-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c53f036

Please sign in to comment.