-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathVerifyAccessToken.cs
More file actions
33 lines (29 loc) · 971 Bytes
/
VerifyAccessToken.cs
File metadata and controls
33 lines (29 loc) · 971 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SignNow.Net.Model;
using SignNow.Net.Service;
namespace SignNow.Net.Examples
{
public partial class OAuth2Examples
{
/// <summary>
/// An example of validating an access token via OAuth 2.0 service.
/// </summary>
[TestMethod]
public async Task VerifyAccessTokenAsync()
{
var oauth = new OAuth2Service(ApiBaseUrl, credentials.Login, credentials.Password);
var dummyToken = new Token
{
AccessToken = "dummyAccessToken",
AppToken = "dummyAppToken",
ExpiresIn = 100,
Scope = "*",
TokenType = TokenType.Bearer
};
var dummyTokenResponse = await oauth.ValidateTokenAsync(dummyToken)
.ConfigureAwait(false);
Assert.IsFalse(dummyTokenResponse);
}
}
}