Skip to content

Commit 17fde8e

Browse files
kbatuigasmicheleRP
andauthored
Clarify auth flows (#15)
* Clarify server variable usage for data plane API * Use overlays to more clearly describe authentication flows * Apply suggestions from automated review * Visual indicator of variable * 'Sign up for emails' is no longer relevant after API GA * Apply suggestions from code review Co-authored-by: Michele Cyran <[email protected]> * Merge commits from review in origin branch * Unwanted file * Fix links * Fix links to other APIs * Minor edits * Minor edits * Accept suggestions from automated review --------- Co-authored-by: Michele Cyran <[email protected]>
1 parent ee96cec commit 17fde8e

File tree

9 files changed

+122
-58
lines changed

9 files changed

+122
-58
lines changed

cloud-controlplane/x-topics/quickstart.md

Lines changed: 41 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
The following steps describe how to authenticate with the Control API and create a new Redpanda cluster. For more information on the Control Plane API, see the Cloud API Overview.
1+
The following steps describe how to authenticate with the Control Plane API and create a new Redpanda cluster. For more information on the Control Plane API, see the [Cloud API Overview](#topic-cloud-api-overview).
22

33
> **Note:** Redpanda Cloud uses a control plane and data plane architecture.
4-
To see the available endpoints for managing resources within your clusters, such as topics, users, access control lists (ACLs), and connectors, see the Data Plane API Reference.
4+
To view the available endpoints for managing resources within your clusters, such as topics, users, access control lists (ACLs), and connectors, see the [Data Plane API Reference](/api/doc/cloud-dataplane).
55

66
## Requirements
77

@@ -14,27 +14,39 @@ To use the Control Plane API:
1414

1515
### Authenticate to the API from API Explorer
1616

17-
To make API requests in your browser, you must obtain an access token. You can do so by clicking **Get token** on the API endpoint you want to call.
17+
The API Explorer lets you interact with the API directly from the documentation. You can quickly explore available endpoints and try requests without setting up your own test environment.
1818

19-
If you successfully retrieve an access token, it is valid for one hour. You can use the same token in requests to both Control Plane and Data Plane API endpoints, for as long as the token is valid.
19+
To make Cloud API requests in your browser, you must obtain an access token. You can do so by clicking **Get token** on the API endpoint you want to call.
2020

21-
## Create a new cluster
21+
If you successfully retrieve an access token, it is valid for one hour. You can use the same token in requests to both Control Plane and Data Plane API endpoints, for as long as the token is valid.
2222

2323
> **Warning:** API requests from the API Explorer are executed against your actual environment and data, not a sandbox.
2424
25+
## Create a new cluster
26+
2527
### BYOC or Dedicated
2628

27-
1. In the page header, click **API Explorer**.
28-
1. On the **Choose an operation** dropdown, select **Create resource group**.
29+
1. In the subheader, open **API Explorer**.
30+
31+
1. In the **Choose an operation** dropdown, select **Create resource group**.
32+
2933
1. Click **Get token**. You may be prompted to log in to the Redpanda Cloud UI. After you log in, the browser automatically redirects you back to the Create resource group endpoint in the API Explorer.
34+
3035
1. Prepare your Create resource group request.
31-
1. Under **Body**, click **+ Add** and provide a name for your resource group. A resource group is a container to organize your Redpanda Cloud resources, such as clusters and networks.
32-
1. Click **Send request**. If successful, the response returns a resource group ID. Pass this ID when you make a Create network request.
33-
1. On the dropdown, select **Create network**.
36+
37+
1. Under **Body**, click **+ Add** and provide a name for your resource group. A resource group is a container to organize your Redpanda Cloud resources, such as clusters and networks.
38+
39+
1. Click **Send request**. If successful, the response returns a resource group ID. Pass this ID when you make a Create network request.
40+
41+
1. In the dropdown, select **Create network**.
42+
3443
1. Prepare your Create network request.
35-
1. Include the ID of the resource group you created in the previous step.
36-
1. Click **Send request**. Note that this endpoint returns a long-running operation. The response returns a network ID in `metadata.network_id`. Pass this ID when you call the Create Cluster endpoint.To check the operation state, make a **Get operation** request with the `operation.id`.
44+
45+
1. Include the ID of the resource group you created in the previous step.
46+
1. Click **Send request**. Note that this endpoint returns a long-running operation. The response returns a network ID in `metadata.network_id`. Pass this ID when you call the Create Cluster endpoint. To check the operation state, make a **Get operation** request with the `operation.id`.
47+
3748
1. When the Create network operation is complete, make a Create cluster request. Use the resource group and network IDs you just created. Note that this endpoint also returns a long-running operation.
49+
3850
1. For BYOC, run `rpk cloud byoc` in the shell, passing the `metadata.cluster_id` from the Create cluster response as a flag:
3951

4052
**AWS:**
@@ -52,27 +64,34 @@ If you successfully retrieve an access token, it is valid for one hour. You can
5264

5365
### Serverless
5466

55-
1. In the page header, click **API Explorer**.
56-
1. On the **Choose an operation** dropdown, select **Create resource group**.
67+
1. In the subheader, open **API Explorer**.
68+
69+
1. In the **Choose an operation** dropdown, select **Create resource group**.
70+
5771
1. Click **Get token**. You may be prompted to log in to the Redpanda Cloud UI. After you log in, the browser automatically redirects you back to the Create resource group endpoint in the API Explorer.
72+
5873
1. Prepare your Create resource group request.
59-
1. Under **Body**, click **+ Add** and provide a name for your resource group. A resource group is a container to organize your Redpanda Cloud resources, such as clusters and networks.
60-
1. Click **Send request**. If successful, the response returns a resource group ID. Pass this ID later when you make a Create Serverless cluster request.
61-
1. On the dropdown, select **Create Serverless cluster**.
74+
75+
1. Under **Body**, click **+ Add** and provide a name for your resource group. A resource group is a container to organize your Redpanda Cloud resources, such as clusters and networks.
76+
1. Click **Send request**. If successful, the response returns a resource group ID. Pass this ID later when you make a Create Serverless cluster request.
77+
78+
1. In the dropdown, select **Create Serverless cluster**.
79+
6280
1. Prepare your Create Serverless cluster request.
63-
1. Make a Get Serverless Regions request to see available regions.
64-
1. In the request body, use the resource group ID and desired cloud region.
65-
1. Click **Send request**. Note that this endpoint returns a long-running operation. The response returns a Serverless cluster ID in `metadata.cluster_id`. To check the operation state, make a **Get operation** request with the `operation.id`.
81+
82+
1. Make a Get Serverless Regions request to see available regions.
83+
1. In the request body, use the resource group ID and desired cloud region.
84+
1. Click **Send request**. Note that this endpoint returns a long-running operation. The response returns a Serverless cluster ID in `metadata.cluster_id`. To check the operation state, make a **Get operation** request with the `operation.id`.
6685

6786
## Next steps: try the Data Plane APIs
6887

6988
1. Retrieve your cluster's data plane API URL by making a **Get cluster** (BYOC, Dedicated) or **Get Serverless cluster** (Serverless) request in the API Explorer.
70-
1. Save the value of `dataplane_api.url` from the response body.
89+
1. From the value of `dataplane_api.url` in the response body, save the subdomain (the part between ``https://` and `.cloud.redpanda.com`).
7190
1. From the **Redpanda APIs** selector, go to **Cloud Data Plane API**.
7291
1. Select an operation, for example **Create topic** or **List users**.
7392
1. In the URL field, add the data plane API URL. You can now make Data Plane API requests to your target cluster.
7493

75-
See also: [Data Plane API Quickstart](https://docs.redpanda.com/api/doc/cloud-dataplane/topic/topic-quickstart)
94+
See also: [Data Plane API Quickstart](/cloud-dataplane/topic/topic-quickstart)
7695

7796
## Suggested reading
7897

cloud-dataplane/cloud-dataplane.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4976,14 +4976,15 @@ security:
49764976
- auth0: []
49774977
servers:
49784978
- description: Data Plane API
4979-
url: 'https://{dataplane_api_url}.cloud.redpanda.com'
4979+
url: '{dataplane_api_url}'
49804980
variables:
49814981
dataplane_api_url:
4982-
default: "dataplane_api.url"
4982+
default: https://{dataplane_api_url}
49834983
description: |-
4984-
Find the Data Plane API base URL of a cluster by calling the Get Cluster endpoint of the Control Plane API. The dataplane_api.url field is returned in the response body.<br><br>
4985-
Example (Dedicated): "https://api-a4cb21.ck09mi9c4vs17hng9gig.fmc.prd.cloud.redpanda.com"<br>
4984+
Find the Data Plane API base URL of a cluster by calling the Get Cluster endpoint of the Control Plane API. The dataplane_api.url field is returned in the response body.
4985+
49864986
Example (BYOC): "https://api-a4cb21.ck09mi9c4vs17hng9gig.byoc.prd.cloud.redpanda.com"
4987+
Example (Dedicated): "https://api-a4cb21.ck09mi9c4vs17hng9gig.fmc.prd.cloud.redpanda.com"
49874988
tags:
49884989
- description: Manage Redpanda access control lists (ACLs). See [Redpanda Cloud Authorization](https://docs.redpanda.com/redpanda-cloud/security/authorization/cloud-authorization/) for more information.
49894990
name: Redpanda ACLs
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Overlay to update server configuration for Bump API Explorer compatibility.
2+
# This updates the server URL, variable description to better match usage in API Explorer.
3+
4+
overlay: 1.0.0
5+
info:
6+
title: Update Server Configuration
7+
version: 1.0.0
8+
actions:
9+
# Update only the server URL template
10+
- target: "$.servers[0].url"
11+
update: "https://{dataplane_api_subdomain}.cloud.redpanda.com"
12+
# Update only the variables section
13+
- target: "$.servers[0].variables"
14+
update:
15+
dataplane_api_subdomain:
16+
default: "{dataplane_api_subdomain}"
17+
description: |-
18+
From the `dataplane_api.url` value in the Control Plane API response, extract the subdomain (the part between `https://` and `.cloud.redpanda.com`). Enter this value in the Data Plane API URL field.
19+
20+
Example: If the URL is `https://api-a4cb21.ck09mi9c4vs17hng9gig.fmc.prd.cloud.redpanda.com`, enter `api-a4cb21.ck09mi9c4vs17hng9gig.fmc.prd`.

cloud-dataplane/x-topics/error-and-status-codes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Example request:
44

55
```bash
66
curl https://<dataplane_api_url>/topics | jq
7+
```
78

89
Example response:
910

cloud-dataplane/x-topics/quickstart.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
The following steps describe how to authenticate with the Data Plane APIs and create a new topic. For more information on the Data Plane APIs, see the Cloud API Overview.
1+
The following steps describe how to authenticate with the Data Plane APIs and create a new topic. For more information on the Data Plane APIs, see the [Cloud API Overview](#topic-cloud-api-overview).
22

3-
> **Note:** Redpanda Cloud uses a control plane and data plane architecture. To see the available endpoints for managing your clusters, networks, and resource groups, see the Control Plane API Reference.
3+
> **Note:** Redpanda Cloud uses a control plane and data plane architecture. To view the available endpoints for managing your clusters, networks, and resource groups, see the [Control Plane API Reference](/api/doc/cloud-controlplane).
44
55
## Requirements
66

@@ -12,24 +12,33 @@ To use the Data Plane APIs:
1212

1313
### Authenticate to the API from API Explorer
1414

15-
To make API requests in your browser, you must obtain an access token. You can do so by clicking **Get token** on the API endpoint you want to call.
15+
The API Explorer lets you interact with the API directly from the documentation. You can quickly explore available endpoints and try requests without setting up your own test environment.
16+
17+
To make Cloud API requests in your browser, you must obtain an access token. You can do so by clicking **Get token** on the API endpoint you want to call.
1618

1719
If you successfully retrieve an access token, it is valid for one hour. You can use the same token in requests to both Control Plane and Data Plane API endpoints, for as long as the token is valid.
1820

21+
> **Warning:** API requests from the API Explorer are executed against your actual environment and data, not a sandbox.
22+
1923
## Create a topic
2024

21-
> **Warning:** API requests from this page are executed against your actual environment and data, not a sandbox.
25+
1. In the subheader, open **API Explorer**.
26+
27+
1. If you don't already have the data plane API URL for your target cluster, make a Get Cluster (BYOC, Dedicated) or Get Serverless Cluster (Serverless) request with the Control Plane API. The response contains the data plane API URL.
28+
29+
From the `dataplane_api.url` value in the response, extract only the subdomain (the part between `https://` and `.cloud.redpanda.com`). Enter this value in the Data Plane API URL field.
30+
31+
1. In the **Choose an operation** dropdown, select **Create topic**.
32+
33+
1. If you need a valid access token, click **Get token**. You may be prompted to log in to the Redpanda Cloud UI. After you log in, the browser automatically redirects you back to the Create topic endpoint in the API Explorer.
2234

23-
1. In the page header, click **API Explorer**.
24-
1. If you don't already have the data plane API URL for your target cluster, make a Get Cluster (BYOC, Dedicated) or Get Serverless Cluster (Serverless) request with the Control Plane API. The response contains the data plane API URL. Copy the value of `dataplane_api.url` from the response body, and enter it in the URL field.
25-
1. On the **Choose an operation** dropdown, select **Create topic**.
26-
1. Click **Get token**. You may be prompted to log in to the Redpanda Cloud UI. After you log in, the browser automatically redirects you back to the Create resource group endpoint in the API Explorer.
2735
1. Enter a name for your topic and click **Send request**.
36+
2837
1. Confirm that your topic is successfully created by making a List topics request.
2938

3039
## Next steps
3140

32-
The quickest ways to produce to and consume from the topic are to use [`rpk`](https://docs.redpanda.com/redpanda-cloud/manage/rpk/rpk-install/) or the [Redpanda HTTP Proxy](https://docs.redpanda.com/api/doc/http-proxy) (BYOC and Dedicated clusters only).
41+
The quickest ways to produce to and consume from the topic are to use [`rpk`](https://docs.redpanda.com/redpanda-cloud/manage/rpk/rpk-install/) or the [Redpanda HTTP Proxy](/api/doc/http-proxy) (BYOC and Dedicated clusters only).
3342

3443
For example, to use `rpk` to produce to a topic named `test-topic`, run:
3544

shared/overlays/update-securityschemes-for-authentication.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,11 @@ info:
77
actions:
88
- target: $.components.securitySchemes.auth0
99
update:
10-
description: The Cloud APIs use OAuth 2.0 for authentication. You must create a service account in the Cloud UI in order to request an access token. You can use the same access token to authenticate requests to both the Control Plane and Data Plane APIs.
10+
description: |-
11+
The Cloud APIs use OAuth 2.0 for authentication.
12+
13+
**For API Explorer (browser):** Authentication is handled automatically. Click "Get token" on any endpoint to authenticate with your Redpanda Cloud account and include a bearer token for requests made in API Explorer.
14+
15+
**For programmatic access (CLI, SDKs, scripts):** You must create a service account in the Redpanda Cloud UI and use the OAuth 2.0 client credentials flow to obtain an access token. See the Authentication topic for detailed instructions.
16+
17+
The same access token can be used for both Control Plane and Data Plane API requests for as long as the token is valid (one hour).

shared/x-topics/about-authentication.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,30 @@
1-
The Cloud API uses the Client Credentials Flow as defined in [Auth 2.0 RFC 6749, section 4.4](https://datatracker.ietf.org/doc/html/rfc6749#section-4.4O). In Redpanda Cloud, you must first create a **service account** through which you can authenticate requests to the Cloud API. The service account is associated with your Redpanda Cloud organization. The service account acts as an OAuth 2.0 client that provides its credentials (client ID and client secret) to the API authentication server. The authentication server grants an access token in return. You can then include the access token in each request to the API.
2-
3-
The access token granted to you is associated with a specific Redpanda Cloud organization. If you want to use the API for a different organization, you must acquire a new token through a service account with that organization.
1+
The Redpanda Cloud API uses OAuth 2.0 for authentication. The authentication method depends on whether you access the API in the browser using the API Explorer or programmatically.
42

53
You only need to authenticate once to the Cloud API. That is, after you obtain an access token, you can use the same token in requests to both Control Plane and Data Plane API endpoints, for as long as the token is valid.
64

7-
## Request an access token
5+
## Authenticate in API Explorer
6+
7+
When using the API Explorer in your browser, Redpanda Cloud uses the [OAuth 2.0 Implicit Flow](https://datatracker.ietf.org/doc/html/rfc6749#section-4.2):
8+
9+
1. Click **Get token** on any API endpoint.
10+
2. Log in with your Redpanda Cloud credentials if prompted. After you log in, you are redirected back to the API Explorer.
11+
3. The token is automatically applied to your API requests.
12+
13+
## Authenticate programmatic requests
14+
15+
For programmatic access (using a CLI, SDKs, and applications), the Cloud API uses the Client Credentials Flow, as defined in [OAuth 2.0 RFC 6749, section 4.4](https://datatracker.ietf.org/doc/html/rfc6749#section-4.4).
16+
17+
You must first create a **service account** through which you can authenticate requests to the Cloud API. The service account is associated with your Redpanda Cloud organization. The service account acts as an OAuth 2.0 client that provides its credentials (client ID and client secret) to the API authentication server. The authentication server grants an access token in return. You can then include the access token in each request to the API.
18+
19+
The access token granted to you is associated with a specific Redpanda Cloud organization. If you want to use the API for a different organization, you must acquire a new token through a service account with that organization.
20+
21+
### Request an access token
822

923
Users with administrative privileges in a Redpanda Cloud organization can create a service account.
1024

1125
> **Note:** Service accounts have administrative privileges by default. Cloud user roles are not applied for the API.
1226
13-
1. On the [Service account](https://cloud.redpanda.com/organization-iam?tab=service-accounts) tab in the Organization IAM page of the Redpanda Cloud UI, click **Create service account**. Enter a name and description.
27+
1. In the Redpanda Cloud UI, go to [Organization IAM](https://cloud.redpanda.com/organization-iam), and select the **Service account** tab. Click **Create service account** and enter a name and description.
1428

1529
2. Copy and store the Client ID and Client Secret. These credentials cannot be viewed again after you close the dialog.
1630

@@ -26,7 +40,7 @@ Users with administrative privileges in a Redpanda Cloud organization can create
2640

2741
The request response provides an access token that remains valid for one hour.
2842

29-
## Authenticate API requests
43+
### Use the access token in API requests
3044

3145
You must pass the access token in the authorization header of each API request:
3246

shared/x-topics/cloud-api-deprecation-policy.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ Redpanda communicates deprecation notices through the following:
4848
* Updates to Cloud API documentation
4949
* [What's New in Redpanda Cloud](https://docs.redpanda.com/redpanda-cloud/get-started/whats-new-cloud)
5050
* Announcements in the #cloudapi [Community Slack](https://redpandacommunity.slack.com/) channel and in individual customer channels
51-
* Emails to "Sign up for updates" recipients (sign up on the [Control Plane API](/api/ROOT/cloud-controlplane-api) and [Data Plane APIs](/api/ROOT/cloud-dataplane-api) reference documentation)
5251

5352
## Versioning policy
5453

0 commit comments

Comments
 (0)