Skip to content

Commit

Permalink
Updated formatting on authentication page
Browse files Browse the repository at this point in the history
  • Loading branch information
codecat committed May 20, 2024
1 parent 87a78c8 commit 14f0219
Showing 1 changed file with 28 additions and 12 deletions.
40 changes: 28 additions & 12 deletions docs/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ Refer to Miss' [Nadeo Go package](https://github.com/codecat/gonadeo) for a comp

Send a POST request to the following URL:

https://public-ubiservices.ubi.com/v3/profiles/sessions
```plain
https://public-ubiservices.ubi.com/v3/profiles/sessions
```

With the following request headers:

Content-Type: application/json
Ubi-AppId: 86263886-327a-4328-ac69-527f0d20a237
Authorization: Basic <[email protected]:password (base64-encoded)>
```plain
Content-Type: application/json
Ubi-AppId: 86263886-327a-4328-ac69-527f0d20a237
Authorization: Basic <[email protected]:password (base64-encoded)>
```

Where the `Authorization` header is a basic authorization of your Ubisoft email and password (e.g. `[email protected]:password` becomes `Basic ZW1haWxAYWRkcmVzcy5jb206cGFzc3dvcmQ=`).
In Go for example, this is done via [SetBasicAuth](https://pkg.go.dev/net/http#Request.SetBasicAuth).
Expand All @@ -31,12 +35,16 @@ User-Agent: My amazing app / [email protected]

The response will contain a Ubisoft authentication ticket that you can use for Nadeo's Ubiservices authentication endpoint. Next, send a POST request to the following URL:

https://prod.trackmania.core.nadeo.online/v2/authentication/token/ubiservices
```plain
https://prod.trackmania.core.nadeo.online/v2/authentication/token/ubiservices
```

With the following request headers:

Content-Type: application/json
Authorization: ubi_v1 t=<full ubi token>
```plain
Content-Type: application/json
Authorization: ubi_v1 t=<full ubi token>
```

Where `Authorization` has your Ubisoft account ticket right after `t=`.

Expand All @@ -48,12 +56,16 @@ If you don't want to or can't use a Ubisoft account for authentication, you can

Send a POST request to the following URL:

https://prod.trackmania.core.nadeo.online/v2/authentication/token/basic
```plain
https://prod.trackmania.core.nadeo.online/v2/authentication/token/basic
```

With the following request headers:

Content-Type: application/json
Authorization: Basic <username:password (base64-encoded)>
```plain
Content-Type: application/json
Authorization: Basic <username:password (base64-encoded)>
```

Where the `Authorization` header is a basic authorization of your dedicated server account (e.g. `username:password` becomes `Basic dXNlcm5hbWU6cGFzc3dvcmQ=`).
In Go for example, this is done via [SetBasicAuth](https://pkg.go.dev/net/http#Request.SetBasicAuth).
Expand Down Expand Up @@ -107,7 +119,9 @@ Where `exp` defines the expiration time, and `rat` the time after which you are

To refresh your token, send a POST to the following URL:

https://prod.trackmania.core.nadeo.online/v2/authentication/token/refresh
```plain
https://prod.trackmania.core.nadeo.online/v2/authentication/token/refresh
```

With the `Authorization` header set to `nadeo_v1 t=<full refresh token>`.

Expand All @@ -119,7 +133,9 @@ All game APIs require you to send the obtained token along - the format is alway

Simply set the following header on all your requests:

Authorization: nadeo_v1 t=<full access token>
```plain
Authorization: nadeo_v1 t=<full access token>
```

And make sure you're using the correct audience for the endpoint (see the table below).

Expand Down

0 comments on commit 14f0219

Please sign in to comment.