Skip to content

AuthenticateJwt

Authenticates the client using a JWT (JSON Web Token).

1
myRestClient.AuthenticateJwt(accessToken: string):RestClient

Parameters

string accessToken
    The JWT access token.

Returns

The current RestClient instance.

Examples

Use a token returned by a token endpoint

1
2
3
4
5
6
7
8
9
var token = $Rest.Create('https://auth.example.com/')
    .Request('oauth/token')
    .AddParameter('grant_type', 'client_credentials')
    .ExecuteJson();

var orders = $Rest.Create('https://api.example.com/')
    .AuthenticateJwt(token['access_token'])
    .Request('orders')
    .ExecuteJson();

See Also