public static async Task AuthPocket(string accessCode = null) { if (string.IsNullOrEmpty(accessCode) && AuthBrowserAction != null) { pocketClient = new PocketClient(POCKETCONSUMERKEY) { CallbackUri = "https://derekantrican.github.io/authsuccess" }; string requestCode = await pocketClient.GetRequestCode(); AuthBrowserAction.Invoke(pocketClient.GenerateAuthenticationUri().ToString()); PocketUser user; while (true) { try { user = await pocketClient.GetUser(requestCode); break; } catch { } Thread.Sleep(500); } accessCode = user.Code; SaveAccessCodeAction?.Invoke(accessCode); } pocketClient = new PocketClient(POCKETCONSUMERKEY, accessCode); }
public async Task <Uri> LoginUriAsync() { client = new PocketClient(ApiKeys.Pocket, callbackUri: App.PocketProtocol); string requestCode = await client.GetRequestCode(); return(client.GenerateAuthenticationUri()); }
public Uri Auth(string callbackUri) { _client.CallbackUri = callbackUri; return(_client.GenerateAuthenticationUri()); }