Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: document rop grant #1581

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions docs/oauth2-oidc/resource-owner-password-grant.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
id: resource-owner-password-grant
title: OAuth2 resource owner password credentials grant
sidebar_label: Resource owner password flow
---

:::info

The resource owner password credentials grant is a legacy grant that is only supported in Ory Network for enterprise customers.
Please contact [[email protected]](mailto:[email protected]) for support.

:::

The OAuth 2.0 Resource Owner Password Credentials Grant is an OAuth 2.0 grant where the application exchanges the user's username
and password for an access token. This grant type is suitable for clients which are highly trusted by the user, such as his or her
computer operating system or a highly privileged application. This grant type works as follows:

1. The resource owner (i.e., the user) provides his or her username and password directly to the client.
2. The client sends a POST request with following parameters in the request body using form encoding to the token endpoint:

- `grant_type`: The value must be `password`.
- `client_id`: The ID of the client that is making the request.
- `client_secret`: The client secret that is used to authenticate the client. Only necessary if `token_endpoint_auth_method` is
set to `"client_secret_post"` in the OAuth2 client.
- `username`: The resource owner username.
- `password`: The resource owner password.

3. If the credentials are valid, the authorization server responds with an access token. This OAuth 2.0 grant does not support
refresh tokens. The client has to ask the user for username and password whenever the access token expires.

To use the Resource Owner Password Credentials Grant, you need to include the "password" grant in the supported grant types. In
the Ory Console, edit the grant types by creating or editing an OAuth client.

The credentials (username and password) are checked against Ory Identities. The user that is authenticated must already exist.

```mdx-code-block
import Mermaid from "@site/src/theme/Mermaid";

<Mermaid
chart={`sequenceDiagram
participant User
participant Client
participant Authorization Server
User->>Client: Provide username and password
Client->>Authorization Server: POST /oauth2/token
Authorization Server->>Authorization Server: Validate credentials against Ory Identities
Authorization Server->>Client: Sends access token
Client->>User: Use access token
`} />
```
1 change: 1 addition & 0 deletions src/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ module.exports = {
"oauth2-oidc/identity-provider-integration-settings",
"oauth2-oidc/client-credentials",
"oauth2-oidc/authorization-code-flow",
"oauth2-oidc/resource-owner-password-grant",
"oauth2-oidc/refresh-token-grant",
"oauth2-oidc/jwt-access-token",
"hydra/guides/oauth2-clients",
Expand Down
Loading