GithubHelp home page GithubHelp logo

ory / docs Goto Github PK

View Code? Open in Web Editor NEW
128.0 14.0 348.0 106.11 MB

The Ory documentation

Home Page: https://www.ory.sh/docs

License: Apache License 2.0

Makefile 0.63% JavaScript 24.01% CSS 8.86% Pug 0.08% TypeScript 47.39% Shell 3.57% Go 7.76% HTML 2.05% PHP 0.56% Kotlin 0.03% Swift 0.11% Objective-C 0.01% Dart 1.87% Dockerfile 0.27% Vue 1.20% C# 0.40% Handlebars 1.20%
documentation ory docs hacktoberfest

docs's Introduction

Ory Documentation

Overview

Ory documentation is the single source of truth for usage, implementation, configuration, and troubleshooting of the Ory Network and all projects of the Ory Ecosystem. The documentation is best consumed through the Ory documentation portal.

To see the source code of each of the projects, visit the project repository:

Documentation of other Ory projects:

Style guide

This style guide outlines the most important rules and conventions that apply to the Ory documentation. If there are no Ory-specific requirements or guidelines for a given topic, refer to the Microsoft Writing Style Guide and follow the rules described there.

Grammar and style

Ory documentation must be clear, concise, and unambiguous. To achieve that, follow these simple rules:

  1. Use active voice and present tense.
  2. Always write in American English.
  3. Use zero conditional when talking about the cause-and-effect in software behavior.
  4. Use the right words to make sure that your message is clear and unambiguous. Don't use words like "should", "could", or "may".
  5. Don't use phrasal verbs, colloquialisms, and jargon.
  6. Don't refer to users in ways that imply their sex.
  7. Don't use contractions of Latin origins such as e.g or i.e.
  8. Remember to use articles (a, an, the) in your writing.
  9. Use common contractions such as aren't, don't, doesn't to sound friendly and informal.

Lists

Ory follows the Microsoft Writing Style Guide list formatting guidelines.

  • List items must begin with a capital letter unless there's a specific reason not to do that. For example, the item is a proper name that's not capitalized, a parameter, or a command wrapped in backticks (`).
  • Don't use punctuation such as commas (,), semicolons (;), or conjunctions (and, or) at the end of list items.
  • Use periods (.) only at the end of list items that are proper sentences, even very short ones.
  • Make list items consistent in structure. For example, if one list item is a full sentence, make all list items full sentences. Don't use different structures for list items in a single list.
  • Indent lines with 3 spaces to denote nested sub-items in lists. Indent text, code blocks, and images.

Headings

  • Use sentence case for headings.
  • The highest heading level in documents is h2. Use h1 only when you override the document title.
  • The lowest heading level in documents is h4. If you absolutely need to add more heading levels, don't go lower than h5.
  • Avoid using symbols and special characters in headings.
  • Leave one blank line before and after a heading.
  • Don't use links in headings.
  • Headings play an important role in SEO and searchability and make the document more scannable. Make your headings short and true to the content they introduce.

Formatting

Write in Markdown. Don't mix HTML tags with Markdown. Files with the .mdx extension use JSX-extended Markdown (MDX).

Document front matter

Add this front matter to every document you create:

---
id: excellent_feature
title: Learn how to use the excellent feature in your implementation
sidebar_label: Excellent feature
slug: excellent-feature-for-some-reason
---
  • id is the document identifier that makes up the last part of the document URL. Try to come up with a short ID that accurately describes the content. IDs that use multiple words must use hyphens (-) to separate the words.
  • title is the document title that’s displayed as the page header. Used by search engines when displaying search results. Try to make it descriptive so that it helps readers understand what the document is about at the first glance. If it comes out long(ish), you can overwrite it by adding a h1 in the very first line following the front matter. Use sentence case.
  • sidebar_label represents the document title used in the sidebar (left navigation). Create a short document title that fits the sidebar width. Use sentence case.
  • slug is an optional property that allows you to customize the document URL. Use it to create more meaningful, SEO-friendly URLs.

Bolding, 'code formatting'

  • Use only code and bold formatting. Don't use any other formatting.
  • For inline code, wrap text in single backticks (`). For code blocks use three backticks (```)
  • Use code formatting for:
    • Commands, for example ory --help
    • File names and paths, for example file.txt, ~/Desktop/git/docs
    • Environment variables, for example CUSTOM_ENV_VAR
  • Use bold only when writing about user interface (UI) elements.

Linking

  • Link to external web pages using absolute links. Don't expose the link on its own. Instead, embed it in descriptive text. For example:

    Ory documentation uses [Prism syntax highlighting](https://prismjs.com/).
    
  • Link to documents within this repository using relative links. When referencing the file, use the file name.

    [Some link](../path/to/file.mdx)
    

Code blocks

  • Always add a programming language identifier to code blocks. Ory documentation uses Prism syntax highlighting.

    ```json
    {some-JSON-code-here}
    ```
    
  • For command line examples, use shell as the programming language identifier. Don't put $ before the command.

    ```shell
    ory get identities
    ```
    
  • For Ory Permissions (Keto) relation tuples, use keto-relation-tuples language identifier, and for relationships use keto-relationships.

    ```keto-relation-tuples
    namespace:object#relation:subject
    // comment
    ```
    
    ```keto-relationships
    namespace:subject is relation of object
    is namespace:subject allowed to permission on object?
    // comment
    ```
    
  • For multi-line commands, indent subsequent lines of the command with two spaces.

    ```shell
    curl --request GET -sL \
      --header "Content-Type: application/json" \
      --header "Authorization: Bearer {ORY_API_KEY}" \
      'https://{project-slug}.projects.oryapis.com/admin/identities/{identity_id}?include_credential=oidc'
    ```
    

Placeholders and dummy data

Using placeholders and dummy data in code snippets and command examples is a good way to ensure that users run commands in the context of their setups and, as a result, achieve success faster. Additionally, this fabricated information prevents leaking of sensitive data such as tokens or API keys.

Follow these rules when using placeholders and dummy data:

  • Introduce placeholders and dummy data in curly brackets ({}).
  • Use colons (-) or underscores (_) to separate multiple words, for example {ORY_SESSION_COOKIE} or {project-slug}.
  • When referring to a project API URL or SDK URL, always use https://{project.slug}.projects.oryapis.com.
  • When referring to scenarios in which the user runs a custom domain, use https://ory.your-custom-domain.com.
  • Always use short, but descriptive, verbal placeholders. Don't mix digits and letters to mimic the format of the data you mock.

UI references

When talking about any user interface (UI) in the Ory documentation, follow these rules:

  • When referring to UI elements, always use the exact text associated with the given element.
  • Format the name of the UI element you refer to in bold.
  • Format any user input with code.

Example: In the Identity Model Schema box, type MyCustomIdentitySchema.

Diagrams

Use Mermaid to create diagrams. You can run the tool locally or use Mermaid Live Editor in the browser. See the Mermaid Cheatsheet for a detailed description on how to use Mermaid.

To add a Mermaid diagram, use this mdx-code-block:

```mdx-code-block
import Mermaid from "@site/src/theme/Mermaid"
<Mermaid
  chart={`

{your-Mermaid-code}

`}
/>
```

Import & reference content

Markdown partials

If a certain piece of content must be re-used across multiple documents in the exact form, it's a good idea to turn it into a partial. Thanks to that, you maintain content in a single file, instead of multiple instances of the same content in many docs.

Add partials to the _common directory.

To import a partial, use this mdx-code-block:

```mdx-code-block
import ExamplePartial from './_common/example.md'

<ExamplePartial />
```

TIP: Headings contained in partials aren't added to the Docusaurus table of contents (ToC). To make sure users can access all headings through the ToC, don't add headings to partials. Instead, add appropriate headings to the document manually and introduce partials after them. To see an implementation of this approach, look at this file.

Code snippets

From GitHub

Use CodeFromRemote to import code directly from GitHub.

Use this mdx-code-block:

```mdx-code-block
import CodeFromRemote from '@theme/CodeFromRemote'

<CodeFromRemote
  lang="js"
  link="https://github.com/ory/kratos-selfservice-ui-node/blob/master/src/middleware/simple.ts"
  src="https://raw.githubusercontent.com/ory/kratos-selfservice-ui-node/master/src/middleware/simple.ts"
  startAt="{CONTENT_FROM_CODE}"
  endAt="{CONTENT_FROM_CODE}"
/>
```
  • lang specifies the programming language the code is in
  • link is the file location displayed in the top part of the code block window
  • src is the direct link used to import the code (optional)
  • startAt , endAt are used to define where the imported snippet starts and ends (optional)

From this repository

```mdx-code-block
import CodeBlock from '@theme/CodeBlock'
import exampleJs from '!!raw-loader!./code-example.jsx'
import exampleGo from '!!raw-loader!./code-example.go'

<CodeBlock className="language-jsx">{exampleJs}</CodeBlock>
<CodeBlock className="language-go">{exampleGo}</CodeBlock>
```

Screenshots and videos

  • Use screenshots and videos sparingly. These resources tend to get out-of-date quickly and are cumbersome to maintain.
  • Screenshots and videos must capture only the relevant parts of the screen.
  • Screenshots and videos must capture UI elements in English. If you’re capturing parts of the browser UI in your work, make sure the UI is in English.
  • Make an effort to get the screenshots and videos looking as clean as possible. Avoid situations where text fields suggest irrelevant inputs, avoid erratic mouse cursor movements and general chaos.
  • You must add media to _static folders.
    • In the _static directory, each document that uses media has its own directory.
    • In the directory of the document, the files have numbers for names, for example, 1.png, 2.png, 3.png. The filenames should reflect the stage at which the media is used in the document. This means that the screenshot named 1.png will be used in line 70, while the diagram 2.svg will be used in line 100.

Compressing images

Compress images you add to the documentation to keep the repository lean. You can use pngquant. Read this article to learn a trick to make your screenshots 80% smaller.

Recording and compressing videos

We recommend using Quicktime to record videos. Follow these rules:

  • Use 16:9 format with at least 1024 pixels of width. ffmpeg will scale it to the right size.
  • Make sure that no history or auto-suggestions are visible.

After recording the video, convert the .mov file to mp4 and webm:

file="screencast.mov"

ffmpeg -i $file -an -c:v libvpx-vp9 -vf scale=1024:-1 -crf 30 -b:v 0 "${file%.*}".webm
ffmpeg -i $file -vcodec h264 -vf scale=1024:-1 -an "${file%.*}".mp4

Use this mdx-code-block to add the video to your document:

```mdx-code-block
import mp4 from './_static/screencast.mp4'
import webm from './_static/screencast.webm'
import VideoEmbed from '@site/src/components/VideoEmbed'

<VideoEmbed mp4={mp4} webm={webm} />
```

Ory Console

Navigating to Ory Console Pages

When referring to specific pages within Ory Console in the documentation, you can use the /current/ route to navigate users to their currently active Ory Network project. For example, to access the Custom UI settings for the currently active Ory Network project in the Console, you can link to: https://console.ory.sh/projects/current/ui

Using the /current/ route you can dynamically direct users to the relevant sections based on their project context.

Testing

To test the documentation locally:

  1. Clone this repository.
  2. Navigate to the cloned repository and run npm install to install all dependencies.
  3. Run the development server and test the changes you made using a fully operational version of the documentation portal that runs on your machine. Run npm run start.
  4. Create a production build to check for any technical issues, such as invalid internal links. Run npm run build.

Formatting documentation

All documents and other files in this repository must be formatted with Prettier using the Ory Prettier styles.

To format all relevant files, run these commands from the main directory of the repository:

make format
git commit -a -m "chore: format"
git push

For a better workflow, install the Prettier plugin for your editor:

Adding content to "Examples" page

The Quickstart overview provides an overview of Ory quickstarts. To add a new example or modify existing entries:

  1. Open examples-content.tsx in src/pages/_assets/.

  2. Copy the following snippet and append it to the correct array (either official, community, or self-hosting examples):

    {
          title: "Protect a Page with Login: NextJs/React", //Your example title goes here
          language: "typescript",                           //The main programming language of your example
          author: "ory",                                    //The author's GitHub handle
          tested: true,                                     //Is the example in ory/examples or ory/docs and has automated tests?
          repo: "https://github.com/ory/docs/tree/master/code-examples/protect-page-login/nextjs", //The repo containing the example code
          docs: "https://www.ory.sh/docs/guides/protect-page-login/next.js",                       //Documentation for the example, can be README, blog article or similar
        },
    • language can be one of: dart, django, docker, erlang, flutter, go, java, javascript, kotlin, kubernetes, nextjs, nodejs, ory, php, python, react, rescript, svelte, typescript, vue
  3. Open a pull request with your changes.

CLI and API reference - auto-generated content

Ory documentation contains auto-generated content such as CLI and API references. Documents of this type are generated from source code and are pushed to this repository by an automated job.

As such, editing any of these documents in the Ory documentation repository isn't the way to change or fix this content. Any changes you make will be overwritten by the next push that follows the generation process.

Instead, find the lines in question in the source code of the Ory projects and edit them there. For example, if you want to edit the documentation of the Ory Kratos CLI, you must edit this file:

https://github.com/ory/kratos/blob/master/cmd/clidoc/main.go

The cmd/clidoc/main.go is the general path for all Ory projects.

The command to generate the CLI docs can be found here: https://github.com/ory/x/blob/master/clidoc/generate.go#L96

docs's People

Contributors

adamwalach avatar aeneasr avatar alnr avatar archived-m avatar arekkas avatar ashutoshgngwr avatar benehiko avatar david-wobrock avatar dependabot[bot] avatar fbolton avatar gen1us2k avatar hperl avatar jonas-jonas avatar kevgo avatar kmherrmann avatar lbbo avatar lopezator avatar marneysof avatar misamu avatar ory-bot avatar orytiki avatar piotrmsc avatar shankardevy avatar tacurran avatar tilschuenemann avatar tomekpapiernik avatar vinckr avatar zepatrik avatar zeropaper avatar zikes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docs's Issues

Extract Prettier configuration into a config file

problem

The Prettier options to format the documentation (proseWrap: always, single-quote, etc) are hardcoded into the format NPM script.

proposed solution

Extract the Prettier options into a Prettier configuration file.

advantages

  • auto-formatters embedded in IDEs (for example Prettier for VSCode) and auto-format bots can find and use the Prettier options
  • the same Prettier options are used throughout the code base
  • calling Prettier manually still uses the right config options

Improve telemetry section

  • Add warden use case so it's easy to understand how this helps improve the product
  • Add note that if there are concerns about this an issue should be created

Why is this a good practice?

in https://github.com/ory/docs/blob/master/docs/oathkeeper/configure-deploy.md#dockerfile there is a statement, "It would also be possible to mount the directory instead, but adding these definitions to the Dockerfile itself and making the build process a part of your CI pipeline is considered good practice!"

Who says it is a good practice to embed configuration and keypairs in an image? A lot of people would consider it a bad practice. Many people who work in container space treat them as simple binaries and execution environments while configuration remains a concern of the orchestration engine. That way a binary can be promoted across many configurations from dev, integration, uat, and prod without changes. In addition, putting sensitive assets like the jwk key pair in revision control or outside of a secured operating environment seems like a patently bad and insecure approach. Contrary to your unsupported recommendation, creating the files in a secured volume that your orchestration engine can mount to the container at runtime seems like it would be the better approach given the potential security sensitivity of the access control configuration and signing key pair.

Again, who says embedding this configuration in your container image is a good idea? Do they have counter-arguments to the concerns I've raised?

The link to Consent Flow is broken

From guides/hydra/README.md

https://github.com/ory/docs/blob/master/guides/hydra/README.md

Hydra is not something that manages user accounts. Hydra does not offer user registration, password reset, user login, sending confirmation emails. This is what the Identity Provider is responsible for. The communication between Hydra and the Identity Provider is called Consent Flow.

The link on "Consent Flow." is broken: https://ory.gitbooks.io/hydra/content/oauth2/consent.html

OAuth2 revoke endpoint documentation needs improvement

I think that the /oauth/revoke endpoint documentation could be improved. I have found that:

  • if the client is not public, then one MUST use the client ID and secret. It seems the oauth2 authentication mentioned there is an option at all.
  • if the client is public, then it is an opposite - since there is no password, then basic authentication is not an option. But then it seems that the client MUST send "cliend_id" form field or it will fail

By the way, I have tested all this with JWT token, not the opaque one. Maybe the behavior is even more complex.

5 Minute Tutorial link broken

Hello,

The link to the "5 Minute Tutorial" from the "Install, Configure and Run ORY Hydra" section is broken.

Before starting with this section, please check out the --> tutorial <--...

Regards,
David

Show how to modify the hydra error page

One thing that could be good to mention in the production documentation, is to configure error pages beforehand.
I haven't had the time yet to check how to configure this. But noticed it was mentioned on the current "default" error page(edited)

Document how to enable JWT in hydra

  • Explain how to validate (./well-known/jwks.json)
  • Explain that you can introspect tokens and revoked tokens will be revoked there too
  • Explain that it's still beta
  • Explain that extra data is set in the token too
  • Explain the claims

Wrong jwt authenticator config example

In the jwt section from Guides > api access rule of oathkeeper doc, value of require_audience and trusted_issuers field in example authenticator config not follow statement claimed above it:

The following rule allows requests to GET http://my-app/some-route if valid a JSON Web Token was provided and if that token has scope scope-a and scope-b, audience aud-1 and was issued by iss-1. All configuration items are optional and ignored if left out.

{
    "id": "some-id",
    "upstream": {
        "url": "http://my-backend-service"
    },
    "match": {
        "url": "http://my-app/some-route",
        "methods": [
            "GET"
        ]
    },
    "authenticators": [{
        "handler": "jwt",
        "config": {
            "required_scope": ["scope-a", "scope-b"],
            "require_audience": ["scope-a", "scope-b"],
            "trusted_issuers": ["scope-a", "scope-b"],
        }
    }],
    /* ... */
}

Wrong API URLs in the developer guide.

In the Implementing a Login & Consent Provider section of the developer guide, the Hydra API URLs mentioned are wrong.

For example, the following snippet is there —

// This is node-js pseudo code and will not work if you copy it 1:1

router.get('/login', function (req, res, next) {
    challenge = req.url.query.login_challenge;

    fetch('https://hydra/oauth2/auth/requests/login/challenge' + challenge).
        then(function (response) {
            // ...
        })
})

Here the URL should have been https://hydra/oauth2/auth/requests/login/ + challenge.

oathkeeper: update judge/decisions endpoint in swagger docs for OS12

Hi there, (again with right account :)
the oathkeeper docs for OS12 reflect the current state of 0.16, but the swagger api docs still state the /judge instead of the new /decision endpoint. This took me a bit to realize, since it is only mentioned in the upgrade docs, so maybe this should be updated :)
If you point out docs or recipe on how to regenerate, I'd be happy to do this myself.
Cheers and thanks for the great tool!
Ref:
https://www.ory.sh/docs/oathkeeper/sdk/api

oathkeeper: update judge/decisions endpoint in swagger docs for OS12

Hi there,
the oathkeeper docs for OS12 reflect the current state of 0.16, but the swagger api docs still state the /judge instead of the new /decision endpoint. This took me a bit to realize, since it is only mentioned in the upgrade docs, so maybe this should be updated :)
If you point out docs or recipe on how to regenerate, I'd be happy to do this myself.
Cheers and thanks for the great tool!
Ref:
https://www.ory.sh/docs/oathkeeper/sdk/api

Versioning scheme and documentation issues.

I'm rather confused on versioning scheme and release cycle for ory ecosystem of products.

Just yesterday I was working with keto and had been deploying with 1.0.0 tagged releases but today it seems like all the docs are completely different and now they're based off a 0.2.2 release.

See tags here: https://hub.docker.com/r/oryd/keto/tags

See docs here: https://www.ory.sh/docs/keto/sdk/api

Did the wrong docs get built for a sandbox/unstable release?

Or what would be recommended to work off of?

Are there docs related to this?

How to store my access token in the browser storage?

Hi all,
I am using the ORY hydra for authentication and authorization. I followed the exact steps as in ory hydra login-consent from node. I got a redirect URL from backend which is giving me access token I want to store it in my browser storage so that I can use to authenticate the API which is called from browser end. I use docker hydra I run the server

docker run -it --rm --name dream-app-login -p 4444:4444 -p 4445:4445 \
    -e OAUTH2_SHARE_ERROR_DEBUG=1 \
    -e LOG_LEVEL=debug \
    -e OAUTH2_CONSENT_URL=http://localhost:4200/consent \
    -e OAUTH2_LOGIN_URL=http://localhost:4200/login \
    -e OAUTH2_ISSUER_URL=http://localhost:4444 \
    -e DATABASE_URL=memory \
    -e CORS_ALLOWED_ORIGINS=* \
    oryd/hydra:v1.0.0-beta.9 serve all --dangerous-force-http

Where the login and consent URL is my front end URL.
Next, I created client

docker run --link dream-app-login:hydra oryd/hydra:v1.0.0-beta.9 clients create \
    --endpoint http://hydra:4445 \
    --id test-client \
    --secret test-secret \
    --response-types code,id_token \
    --grant-types refresh_token,authorization_code \
    --scope openid,offline \
    --callbacks http://127.0.0.1:4446/callback

In the above i want to change the callback url to my front end url which is localhost:4200 but when i tried the application was not running.

And now running the authorization grant flow with this

docker run -p 4446:4446 --link dream-app-login:hydra oryd/hydra:v1.0.0-beta.9 token user \
    --token-url http://hydra:4444/oauth2/token \
    --auth-url http://localhost:4444/oauth2/auth \
    --scope openid,offline \
    --client-id test-client \
    --client-secret test-secret 

After this, I open the browser and did the login and consent flow and got the tokens but I want to store them in my browser storage like session storage or local storage. So is there any way to do that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.