Skip to content

Commit 97a4b59

Browse files
committed
Fix token fields in auth docs
1 parent d4d586f commit 97a4b59

File tree

2 files changed

+50
-50
lines changed

2 files changed

+50
-50
lines changed

docs/auth/dedi.md

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
1-
---
2-
position: 1
3-
---
4-
# Dedicated server account
5-
6-
If you don't want to or can't use a Ubisoft account for authentication, you can use a [dedicated server account](https://www.trackmania.com/player/dedicated-servers). Note that there are some limitations on what you can do with dedicated server tokens (as noted on relevant API endpoint documentation pages).
7-
8-
## Setting up a dedicated server account
9-
10-
A dedicated server account is always bound to a Ubisoft account. Visit [Trackmania.com's dedicated servers page](https://www.trackmania.com/player/dedicated-servers) to create a dedicated server account.
11-
12-
Make sure to store the password after creating your account as it can't be retrieved again later.
13-
14-
Note that your dedicated server account is directly associated to a Ubisoft account - if Nadeo/Ubisoft detect API usage they deem unacceptable, restrictions or bans on your dedicated server account may also have consequences for your associated Ubisoft account.
15-
16-
## Acquiring a Nadeo API access token
17-
18-
Send the following HTTP request using a tool/library of your choice:
19-
20-
```plain
21-
POST https://prod.trackmania.core.nadeo.online/v2/authentication/token/basic
22-
23-
Headers:
24-
Content-Type: application/json
25-
Authorization: Basic <login:password (base64-encoded)>
26-
User-Agent: <your project/contact information>
27-
28-
Body:
29-
{ "audience": "NadeoLiveServices" }
30-
```
31-
32-
The `Authorization` header uses [Basic HTTP authentication](https://en.wikipedia.org/wiki/Basic_access_authentication#Client_side) for your dedicated server account credentials (e.g. `username:password` becomes `Basic dXNlcm5hbWU6cGFzc3dvcmQ=`).
33-
In Go for example, this is done via [SetBasicAuth](https://pkg.go.dev/net/http#Request.SetBasicAuth) - other languages and libraries have their own utility methods for the same purpose.
34-
35-
The body of the request must be a JSON object with the desired audience name. The audience(s) you need depend on the APIs and endpoints you intend to interact with.
36-
37-
| URL | Audience |
38-
| -------------------------------------------- | ----------------- |
39-
| <https://prod.trackmania.core.nadeo.online/> | NadeoServices |
40-
| <https://live-services.trackmania.nadeo.live/> | NadeoLiveServices |
41-
| <https://meet.trackmania.nadeo.club> | NadeoLiveServices |
42-
43-
Note that if you don't provide a body, you get a token for the audience `NadeoServices`.
44-
45-
If you plan to interact with API endpoints that require different audiences, you need to request multiple tokens and manage them separately.
46-
47-
## Next steps
48-
49-
The response body contains an `access_token` and a `refresh_token` which you can use for your API requests. See the [token usage guide](/auth/token) for information on how to use and manage tokens.
1+
---
2+
position: 1
3+
---
4+
# Dedicated server account
5+
6+
If you don't want to or can't use a Ubisoft account for authentication, you can use a [dedicated server account](https://www.trackmania.com/player/dedicated-servers). Note that there are some limitations on what you can do with dedicated server tokens (as noted on relevant API endpoint documentation pages).
7+
8+
## Setting up a dedicated server account
9+
10+
A dedicated server account is always bound to a Ubisoft account. Visit [Trackmania.com's dedicated servers page](https://www.trackmania.com/player/dedicated-servers) to create a dedicated server account.
11+
12+
Make sure to store the password after creating your account as it can't be retrieved again later.
13+
14+
Note that your dedicated server account is directly associated to a Ubisoft account - if Nadeo/Ubisoft detect API usage they deem unacceptable, restrictions or bans on your dedicated server account may also have consequences for your associated Ubisoft account.
15+
16+
## Acquiring a Nadeo API access token
17+
18+
Send the following HTTP request using a tool/library of your choice:
19+
20+
```plain
21+
POST https://prod.trackmania.core.nadeo.online/v2/authentication/token/basic
22+
23+
Headers:
24+
Content-Type: application/json
25+
Authorization: Basic <login:password (base64-encoded)>
26+
User-Agent: <your project/contact information>
27+
28+
Body:
29+
{ "audience": "NadeoLiveServices" }
30+
```
31+
32+
The `Authorization` header uses [Basic HTTP authentication](https://en.wikipedia.org/wiki/Basic_access_authentication#Client_side) for your dedicated server account credentials (e.g. `username:password` becomes `Basic dXNlcm5hbWU6cGFzc3dvcmQ=`).
33+
In Go for example, this is done via [SetBasicAuth](https://pkg.go.dev/net/http#Request.SetBasicAuth) - other languages and libraries have their own utility methods for the same purpose.
34+
35+
The body of the request must be a JSON object with the desired audience name. The audience(s) you need depend on the APIs and endpoints you intend to interact with.
36+
37+
| URL | Audience |
38+
| -------------------------------------------- | ----------------- |
39+
| <https://prod.trackmania.core.nadeo.online/> | NadeoServices |
40+
| <https://live-services.trackmania.nadeo.live/> | NadeoLiveServices |
41+
| <https://meet.trackmania.nadeo.club> | NadeoLiveServices |
42+
43+
Note that if you don't provide a body, you get a token for the audience `NadeoServices`.
44+
45+
If you plan to interact with API endpoints that require different audiences, you need to request multiple tokens and manage them separately.
46+
47+
## Next steps
48+
49+
The response body contains an `accessToken` and a `refreshToken` which you can use for your API requests. See the [token usage guide](/auth/token) for information on how to use and manage tokens.

docs/auth/ubi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,4 @@ If you plan to interact with API endpoints that require different audiences, you
8686

8787
## Next steps
8888

89-
The final response body contains an `access_token` and a `refresh_token` which you can use for your API requests. See the [token usage guide](/auth/token) for information on how to use and manage tokens.
89+
The final response body contains an `accessToken` and a `refreshToken` which you can use for your API requests. See the [token usage guide](/auth/token) for information on how to use and manage tokens.

0 commit comments

Comments
 (0)