-
Notifications
You must be signed in to change notification settings - Fork 36
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
9 changed files
with
173 additions
and
198 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
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,9 @@ | ||
namespace Sidekick.Apis.Poe.Authentication | ||
{ | ||
public enum AuthenticationState | ||
{ | ||
Unauthenticated, | ||
InProgress, | ||
Authenticated, | ||
} | ||
} |
13 changes: 4 additions & 9 deletions
13
src/Sidekick.Apis.Poe/Authentication/IAuthenticationService.cs
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,18 +1,13 @@ | ||
using Sidekick.Apis.Poe.Trade.Models; | ||
using Sidekick.Common.Game.Items; | ||
|
||
namespace Sidekick.Apis.Poe.Authentication | ||
{ | ||
public interface IAuthenticationService | ||
{ | ||
Task Authenticate(); | ||
event Action? OnStateChanged; | ||
|
||
Task<string> AuthenticationCallback(string auth, string state); | ||
AuthenticationState CurrentState { get; } | ||
|
||
string GetAccessToken(); | ||
string? GetToken(); | ||
|
||
bool IsAuthenticated(); | ||
|
||
bool IsAuthenticating(); | ||
Task Authenticate(); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/Sidekick.Apis.Poe/Authentication/Models/Oauth2TokenResponse.cs
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,13 @@ | ||
namespace Sidekick.Apis.Poe.Authentication.Models | ||
{ | ||
internal class Oauth2TokenResponse | ||
{ | ||
public string? access_token { get; set; } | ||
public int expires_in { get; set; } | ||
public string? token_type { get; set; } | ||
public string? scope { get; set; } | ||
public string? username { get; set; } | ||
public string? sub { get; set; } | ||
public string? refresh_token { get; set; } | ||
} | ||
} |
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
Oops, something went wrong.