<@U04UQ68083H> How do i enable M2M or device flow ...
# ory-copilot
g
@chilly-king-10285 How do i enable M2M or device flow in hydra open source
b
A message from kapa.ai
To enable Machine-to-Machine (M2M) or Device Flow in Ory Hydra open source, you need to create OAuth2 clients with the appropriate grant types. Let me explain how to set this up for each flow: ## Machine-to-Machine (Client Credentials Flow) The Client Credentials flow is used for machine-to-machine authentication. To enable it: 1. Create an OAuth2 client with the
client_credentials
grant type:
Copy code
hydra create oauth2-client \   --name "M2M Client" \   --grant-type client_credentials \   --scope your_scope1,your_scope2
2. You can then use this client to perform the OAuth2 Client Credentials flow and receive an access token. [Hydra CLI documentation](https://www.ory.sh/docs/hydra/cli/hydra-create-oauth2-client#hydra-create-oauth2-client) provides more details on creating OAuth2 clients with specific parameters. ## Device Flow For the Device Flow (useful for devices with limited input capabilities like smart TVs): 1. Create an OAuth2 client with the
urn:ietf:params:oauth:grant-type:device_code
grant type:
Copy code
hydra create oauth2-client \   --name "Device Flow Client" \   --grant-type "urn:ietf:params:oauth:grant-type:device_code" \   --scope your_scope1,your_scope2
The Device Flow is designed for devices that have limited inputs or do not have a web browser, allowing users to authorize applications on such devices to access their accounts by initiating the flow on a separate device. ## Usage Examples For M2M authentication, after creating the client, you can exchange the client credentials for an access token as described in the [Run your own OAuth2 Server blog post](https://www.ory.sh/blog/run-oauth2-server-open-source-api-security). For more information on when to use these flows: - M2M is ideal for server-to-server communication where user interaction isn't needed - Device Flow is best for smart devices, TVs, or game consoles with limited input capabilities You can find more details about OAuth2 use cases in the [OAuth2 fundamentals documentation](https://www.ory.sh/docs/oauth2-oidc/overview/oauth2-concepts#use-case-examples).
g
So how do i enable them?
@chilly-king-10285 how do i enable them in open source version of Hydra. I can ping Vincent if i want the answer to be "buy our enterprise product 🙂 "
b
A message from kapa.ai
I understand you're looking for specific instructions on enabling M2M (Client Credentials) and Device Flow in the open source version of Ory Hydra, not the enterprise offering. For the open source version of Ory Hydra, you can enable these flows by following these steps: ## Installing Ory Hydra Open Source First, make sure you have Ory Hydra installed. You can install it in several ways:
Copy code
bash # Linux bash <(curl <https://raw.githubusercontent.com/ory/meta/master/install.sh>) -d -b . hydra <version-you-want>  # macOS brew install ory/tap/hydra  # Windows scoop bucket add ory <https://github.com/ory/scoop.git> scoop install hydra  # Docker docker pull oryd/hydra:<version-you-want>
[Hydra Self-hosted Installation](https://www.ory.sh/docs/hydra/self-hosted/install) ## Enabling M2M (Client Credentials Flow) To enable the Client Credentials flow in open source Hydra: 1. Create an OAuth2 client with the client_credentials grant type:
Copy code
bash hydra create oauth2-client \     --name "Client Credentials Demo" \     --grant-type client_credentials
2. Use the client ID and secret to perform the OAuth2 Client Credentials flow:
Copy code
bash hydra perform client-credentials \   --client-id=<your-client-id> \   --client-secret=<your-client-secret>
3. You can validate the token using introspection:
Copy code
bash hydra introspect token <access-token>
[Run your own OAuth2 Server](https://www.ory.sh/blog/run-oauth2-server-open-source-api-security) ## Enabling Device Flow For Device Flow in open source Hydra: 1. Create an OAuth2 client with the device code grant type:
Copy code
bash hydra create oauth2-client \   --name "Device Flow Client" \   --grant-type "urn:ietf:params:oauth:grant-type:device_code"
Both of these flows are fully supported in the open source version of Ory Hydra, and you don't need to purchase any enterprise product to use them. If you encounter any issues during setup, you can get help from the community through: - [Ory Hydra GitHub Discussions](https://github.com/ory/hydra/discussions) - [Ory Community Slack](https://www.ory.sh/chat) [Welcome to Ory!](https://www.ory.sh/docs/welcome#need-help)
g
@chilly-king-10285 how can i curl to initiate the device flow
b
A message from kapa.ai
I can show you how to initiate the OAuth2 Device Flow using curl with Ory Hydra. According to the documentation, you'll need to make a POST request to the device authorization endpoint. Here's how to initiate the device flow using curl:
Copy code
bash curl -X POST '<https://your-hydra-instance/oauth2/device/auth>' \   -H 'Content-Type: application/x-www-form-urlencoded' \   -d 'client_id=YOUR_CLIENT_ID&scope=openid offline'
This request will return a JSON response containing: - `device_code`: The verification code for the device - `user_code`: The code the user needs to enter on another device - `verification_uri`: The URL where the user should go to enter the code - `verification_uri_complete`: A URL that includes the user code - `expires_in`: The lifetime of the codes in seconds - `interval`: How often the device should poll for completion The API specification for this endpoint is documented in the [Hydra API Reference](https://www.ory.sh/docs/hydra/reference/api). After initiating the flow, the user would go to the
verification_uri
on another device, enter the
user_code
, and authorize the application. Meanwhile, your device would poll the token endpoint to check if authorization has been granted. Note that as mentioned in the documentation: "This endpoint is not documented here because you should never use your own implementation to perform OAuth2 flows. OAuth2 is a very popular protocol and a library for your programming language will exist." While you can use curl for testing, in production it's recommended to use an OAuth2 library for your programming language. For more information on the Device Flow, you can refer to [RFC 8628](https://tools.ietf.org/html/rfc8628) which is the official specification. [Hydra API Reference](https://www.ory.sh/docs/hydra/reference/api)
g
@chilly-king-10285 which release was this introduced in? When will 2.4.0 of hydra oss going to be released?
b
A message from kapa.ai
Based on the knowledge sources provided, I don't have specific information about which release of Ory Hydra introduced the Device Flow feature or when version 2.4.0 of Hydra OSS will be released. The knowledge sources contain information about various aspects of Ory Hydra, including how to use the OAuth2 flows, but they don't mention the specific release that introduced the Device Flow or provide a timeline for the 2.4.0 release. For the most up-to-date information about release dates and feature introductions, I would recommend: 1. Checking the [Ory Hydra Changelog](https://github.com/ory/hydra/blob/master/CHANGELOG.md) which is mentioned in the ecosystem changelog document. 2. Looking at the [Ory Hydra GitHub Discussions](https://github.com/ory/hydra/discussions) where you might find information about upcoming releases. 3. Joining the [Ory Community Slack](https://www.ory.sh/chat) to ask about specific release timelines. If you need definitive information about release dates or when specific features were introduced, these resources would be more helpful than what's available in the provided knowledge sources.
g
@chilly-king-10285 when with hydra 2.4.0 be released?
b
A message from kapa.ai
Based on the knowledge sources provided, there is no specific information about when Hydra 2.4.0 will be released. However, I can share some relevant information about Ory's release process and current situation. According to a GitHub issue comment, there haven't been new releases for Ory Hydra in about 10 months: > Hello @aeneasr, following up on this issue I can't see new releases since 10 months for ory/hydra. [Github Issue: Confusing container versions](https://github.com/ory/hydra/issues/3617) Additionally, there's a GitHub discussion about Keto's bulk permissions check functionality where an Ory representative stated: > At the moment it is not possible to commit to a release date or predict when a release is needed, so next release is coming "when its done". The goal is to release quarterly or at least several times per year. [Release date for Keto's Bulk permissions check functionality?](https://github.com/ory/keto/discussions/1606) While this statement is about Keto rather than Hydra, it suggests that Ory generally doesn't commit to specific release dates for their open-source projects. For the most up-to-date information, you might want to: 1. Check the [Ory Hydra Changelog](https://github.com/ory/hydra/blob/master/CHANGELOG.md) 2. Join the [Ory Community Slack](https://slack.ory.sh/) 3. Follow [Ory Hydra Discussions](https://github.com/ory/hydra/discussions) Ory also recommends signing up for their [Security Newsletter](https://www.ory.sh/l/sign-up-newsletter) to stay informed about important software updates.
g
@chilly-king-10285 when was the last hydra release? How often have they released in the past?
b
A message from kapa.ai
Based on the knowledge sources provided, I don't have specific information about the exact date of the last Hydra release. However, there is some relevant information about Ory's release patterns: According to a GitHub issue comment, there haven't been new releases for Ory Hydra in about 10 months as of the time that comment was made: > Hello @aeneasr, following up on this issue I can't see new releases since 10 months for ory/hydra. [Github Issue: Confusing container versions](https://github.com/ory/hydra/issues/3617) Regarding how often Ory releases software, there are different patterns for different versions: 1. For open source releases: - According to the blog post comparing Ory Network and self-hosting: "Ory Network releases new features and updates on a daily basis, while open source releases are quarterly." [Ory Network or self-hosted?](https://www.ory.sh/blog/ory-network-or-self-hosting-explained-use-cases) 2. For Ory Enterprise License (OEL) versions: - The documentation shows regular releases, with multiple releases per month. For example, in March 2025 alone, there were releases on March 4, 6, 11, 12, 14, 20, 27, and 31. [Ory Hydra OEL Docker Registry](https://www.ory.sh/docs/self-hosted/oel/quickstart#docker-registry) 3. For Keto (another Ory product), an official response in a GitHub discussion stated: > At the moment it is not possible to commit to a release date or predict when a release is needed, so next release is coming "when its done". The goal is to release quarterly or at least several times per year. [Release date for Keto's Bulk permissions check functionality?](https://github.com/ory/keto/discussions/1606) For the most up-to-date information about Hydra releases, you might want to check the [Ory Hydra Changelog](https://github.com/ory/hydra/blob/master/CHANGELOG.md) or join the [Ory Community Slack](https://slack.ory.sh/).