-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
380 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,23 @@ | ||
# Authentication | ||
|
||
The library provides methods to retrieve information about a player account, such as the characters, bank, inventory, wallet, unlocked skins, etc. You need a valid access token to use these methods. | ||
The library provides methods to retrieve information about a player account, such | ||
as the characters, bank, inventory, wallet, unlocked skins, etc. You need a valid | ||
access token to use these methods. | ||
|
||
``` csharp | ||
var characters = await gw2.Accounts.GetCharacters( | ||
accessToken: "API key or subtoken" | ||
); | ||
``` | ||
|
||
To obtain an API key, you need a Guild Wars 2 account and log in to <https://account.arena.net/applications>, create a New Key, and store it somewhere safely in your application secrets (not in source control.) | ||
To obtain an API key, you need a Guild Wars 2 account and log in to | ||
<https://account.arena.net/applications>, create a New Key, and store it | ||
somewhere safely in your application secrets (not in source control.) | ||
|
||
You can use the `TokenProvider` class to validate an access token that you received from someone else. You can also use it to create a subtoken with a shorter time-to-live or with fewer privileges. This is useful if you wish to give someone else limited access to your account. For example: if you build a modular application that can be extended with 3rd-party plugins, you may ask the user for a full-access master token and then create a subtoken for each plugin, giving it only the permissions it needs and the time it needs. | ||
You can use the `TokenProvider` class to validate an access token that you received | ||
from someone else. You can also use it to create a subtoken with a shorter time-to-live | ||
or with fewer privileges. This is useful if you wish to give someone else limited | ||
access to your account. For example: if you build a modular application that can | ||
be extended with 3rd-party plugins, you may ask the user for a full-access master | ||
token and then create a subtoken for each plugin, giving it only the permissions | ||
it needs and the time it needs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,48 @@ | ||
# Installation | ||
|
||
The recommended way to install the Guild Wars 2 SDK is to use the [NuGet package][nuget]. You can install the package from the command line using the .NET CLI. | ||
The recommended way to install the Guild Wars 2 SDK is to use the [NuGet package][nuget]. | ||
You can install the package from the command line using the .NET CLI. | ||
|
||
``` sh | ||
dotnet add package GW2SDK | ||
``` | ||
|
||
## Development packages | ||
|
||
You can install development packages from GitHub from [here][packages]. These packages are updated on every commit to the main branch and versioned by number of git commits since the last release. (Format: 1.0.0-preview.0.123) | ||
You can install development packages from GitHub from [here][packages]. These packages | ||
are updated on every commit to the main branch and versioned by number of git commits | ||
since the last release. (Format: 1.0.0-preview.0.123) | ||
|
||
First create a personal access token [here][tokens] with the _read:packages_ scope. Then run the following command. | ||
First create a personal access token [here][tokens] with the _read:packages_ scope. | ||
Then run the following command. | ||
|
||
``` sh | ||
dotnet nuget add source https://nuget.pkg.github.com/sliekens/index.json --name sliekens --username <USERNAME> --password <TOKEN> | ||
dotnet nuget add source https://nuget.pkg.github.com/sliekens/index.json \ | ||
--name sliekens \ | ||
--username <USERNAME> --password <TOKEN> | ||
``` | ||
|
||
Replace: | ||
|
||
- USERNAME with the name of your user account on GitHub. | ||
- TOKEN with your personal access token. | ||
Replace `USERNAME` with the name of your user account on GitHub. | ||
Replace `TOKEN` with your personal access token. | ||
|
||
By default, your token is stored in encrypted format in your user directory. | ||
|
||
- Windows: `%appdata%\NuGet\NuGet.Config` | ||
- Mac/Linux: `~/.config/NuGet/NuGet.Config` or `~/.nuget/NuGet/NuGet.Config` (varies by OS distribution) | ||
- Mac/Linux: `~/.config/NuGet/NuGet.Config` or `~/.nuget/NuGet/NuGet.Config` | ||
(varies by OS distribution) | ||
|
||
Encryption is not supported on every platform. If you get an error, try the command again with `--store-password-in-clear-text`. | ||
Encryption is not supported on every platform. If you get an error, try the | ||
command again with `--store-password-in-clear-text`. | ||
|
||
## Uninstalling development packages | ||
|
||
To stop using development packages, you can remove the NuGet source from your machine. This will remove the source and your token. | ||
To stop using development packages, you can remove the NuGet source from your | ||
machine. This will remove the source and your token. | ||
|
||
``` sh | ||
dotnet nuget remove source sliekens | ||
``` | ||
|
||
[tokens]:https://github.com/settings/tokens | ||
[packages]:https://github.com/sliekens/gw2sdk/packages | ||
[nuget]:https://www.nuget.org/packages/GW2SDK/ | ||
[nuget]:https://www.nuget.org/packages/GW2SDK/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
div.content { | ||
max-width: 80ch; | ||
word-wrap: break-word; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters