Updated docs regarding Refresh of Tokens and fixed dead links

This commit is contained in:
Jonas Dellinger 2019-11-11 17:01:23 +01:00
parent e5092ba779
commit 16ff9b8a7f
2 changed files with 18 additions and 2 deletions

View File

@ -37,3 +37,19 @@ static async void Main(string[] args)
auth.OpenBrowser(); auth.OpenBrowser();
} }
``` ```
## Token Refresh
Once the `AccessToken` is expired, you can use your `RefreshToken` to get a new one.
In this procedure, no HTTP Server is needed in the background and a single HTTP Request is made.
```csharp
// Auth code from above
if(token.IsExpired())
{
Token newToken = await auth.RefreshToken(token.RefreshToken);
api.AccessToken = newToken.AccessToken
api.TokenType = newToken.TokenType
}
```

View File

@ -20,9 +20,9 @@ Now you can start with the user-authentication, Spotify provides 3 ways (4 if yo
* [TokenSwapAuth](/auth/token_swap.md) (**Recommended**, server-side code mandatory, most secure method. The necessary code is shown here so you do not have to code it yourself.) * [TokenSwapAuth](/auth/token_swap.md) (**Recommended**, server-side code mandatory, most secure method. The necessary code is shown here so you do not have to code it yourself.)
* [AutorizationCodeAuth](/auth/autorization_code.md) (Not recommended, server-side code needed, else it's unsecure) * [AutorizationCodeAuth](/auth/authorization_code.md) (Not recommended, server-side code needed, else it's unsecure)
* [ClientCredentialsAuth](/auth/client_credentials_auth.md) (Not recommended, server-side code needed, else it's unsecure) * [ClientCredentialsAuth](/auth/client_credentials.md) (Not recommended, server-side code needed, else it's unsecure)
Overview: Overview:
![Overview](http://i.imgur.com/uf3ahTl.png) ![Overview](http://i.imgur.com/uf3ahTl.png)