Skip to content

Commit 3dfe454

Browse files
Updated documentation
1 parent dfbd73f commit 3dfe454

3 files changed

Lines changed: 35 additions & 47 deletions

File tree

README.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,20 @@ authentication.
4747

4848
To authenticate your API call, follow the instructions for your configured authentication mode:
4949

50-
- Local Database (default) : Uses the same credentials as the pfSense webConfigurator. To authenticate API calls, simply
51-
add a `client-id` value containing your username and a `client-token` value containing your password to your payload. For
52-
example `{"client-id": "admin", "client-token": "pfsense"}`
53-
54-
- JWT : Requires a bearer token to be included in the `Authorization` header of your request. To receive a bearer token,
55-
you may make a POST request to /api/v1/access_token/ and include a `client-id` value containing your pfSense username
56-
and a `client-token` value containing your pfSense password to your payload. For example
57-
`{"client-id": "admin", "client-token": "pfsense"}`. Once you have your bearer token, you can authenticate your API
58-
call by adding it to the request's authorization header. (e.g. `Authorization: Bearer xxxxxxxx.xxxxxxxxx.xxxxxxxx`)
59-
60-
- API Token : Uses standalone tokens generated via the UI. These are better suited to distribute to systems as they are
61-
revocable and will only allow API authentication and not UI or SSH authentication (like the local database credentials).
62-
To generate or revoke credentials, navigate to System > API within the UI and ensure the Authentication Mode is set to
63-
API token. Then you should have the options to configure API Token generation, generate new tokens, and revoke existing
64-
tokens. Once you have your API token, you may authenticate your API call by adding a `client-id` value containing your
65-
API token client ID and a `client-token` value containing your API token client token to your payload.
66-
(e.g. `{"client-id": "cccdj-311s", "client-token": "42jkjl-k234jlk1b38123kj3kjl-ffwzzuilaei"}`
50+
<details>
51+
<summary>Local Database (default)</summary
52+
Uses the same credentials as the pfSense webConfigurator. To authenticate API calls, simply add a `client-id` value containing your username and a `client-token` value containing your password to your payload. For example `{"client-id": "admin", "client-token": "pfsense"}`
53+
</details>
54+
55+
<details>
56+
<summary>JWT</summary
57+
Requires a bearer token to be included in the `Authorization` header of your request. To receive a bearer token, you may make a POST request to /api/v1/access_token/ and include a `client-id` value containing your pfSense username and a `client-token` value containing your pfSense password to your payload. For example `{"client-id": "admin", "client-token": "pfsense"}`. Once you have your bearer token, you can authenticate your APIcall by adding it to the request's authorization header. (e.g. `Authorization: Bearer xxxxxxxx.xxxxxxxxx.xxxxxxxx`)
58+
</details>
59+
60+
<details>
61+
<summary>API Token</summary
62+
Uses standalone tokens generated via the UI. These are better suited to distribute to systems as they are revocable and will only allow API authentication and not UI or SSH authentication (like the local database credentials). To generate or revoke credentials, navigate to System > API within the UI and ensure the Authentication Mode is set to API token. Then you should have the options to configure API Token generation, generate new tokens, and revoke existing tokens. Once you have your API token, you may authenticate your API call by adding a `client-id` value containing yourAPI token client ID and a `client-token` value containing your API token client token to your payload. (e.g. `{"client-id": "cccdj-311s", "client-token": "42jkjl-k234jlk1b38123kj3kjl-ffwzzuilaei"}`
63+
</details>
6764

6865
# Authorization
6966
pfSense API uses the same privielges as the pfSense webConfigurator. The required privileges for each endpoint are stated within the API documentation.
@@ -4173,3 +4170,4 @@ URL: https://{{$hostname}}/api/v1/user/privilege
41734170

41744171
---
41754172
[Back to top](#pfsense-rest-api-documentation)
4173+
> Made with &#9829; by [thedevsaddam](https://github.com/thedevsaddam) | Generated at: 2020-09-27 10:50:11 by [docgen](https://github.com/thedevsaddam/docgen)

0 commit comments

Comments
 (0)