Skip to content

Commit

Permalink
docs(README): add instruction on using SwaggerUI
Browse files Browse the repository at this point in the history
  • Loading branch information
MrOrz committed Nov 18, 2024
1 parent bd549dd commit fd28e66
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/adm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,17 @@ curl -XPOST -H "CF-Access-Client-Id: <CLIENT_ID>" -H "CF-Access-Client-Secret: <
```

The response would attach a cookie named `CF_Authorization` that you may use for [subsequent requests](https://developers.cloudflare.com/cloudflare-one/identity/service-tokens/#subsequent-requests).

## Sending request via Swagger UI

You can send test requests in this Swagger UI in the browser using your current login session.

However, since different APIs are managed by different Cloudflare Access Applications, your current
login session may not yet be authorized to the API you want to call. In this case, you may see your
request sent in Swagger UI being redirected to Cloudflare, and is then blocked by the browser.

To authorize your current login session to an API, try visiting the API path directly.
For example, in order to call `/moderation/blockUser`, you can first [visit `/moderation`](/moderation) directly in your browser.
Cloudflare will do the authorization and redirect you to the 404 page.
By that time your login session cookie should have been updated, and you can then call
`/moderation/blockUser` in `/docs`'s Swagger UI.

0 comments on commit fd28e66

Please sign in to comment.