This repository has been archived by the owner on Sep 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
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
1 parent
9e1165a
commit 6e7eb51
Showing
4 changed files
with
33 additions
and
1 deletion.
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
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,28 @@ | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using Branch.Global.Contracts; | ||
using Branch.Global.Libraries; | ||
using Microsoft.AspNetCore.Http; | ||
|
||
namespace Branch.Services.Token | ||
{ | ||
public class TokenClient : ITokenService | ||
{ | ||
private JsonClient _client { get; } | ||
|
||
public TokenClient(string baseUrl, string key) | ||
{ | ||
var options = new HttpClientOptions | ||
{ | ||
Headers = new Dictionary<string, string> { { "Authorization", $"bearer {key}" } }, | ||
}; | ||
|
||
_client = new JsonClient(baseUrl, options); | ||
} | ||
|
||
public async Task<GetXblTokenResponse> GetXblToken(HttpContext ctx, GetTokenRequest req) | ||
{ | ||
return await _client.Do<GetXblTokenResponse>("POST", "1/2020-04-27/get_xbl_token", req); | ||
} | ||
} | ||
} |
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