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);
        }
Exemple #2
0
        public async Task <Uri> LoginUriAsync()
        {
            client = new PocketClient(ApiKeys.Pocket, callbackUri: App.PocketProtocol);
            string requestCode = await client.GetRequestCode();

            return(client.GenerateAuthenticationUri());
        }
Exemple #3
0
 public Uri Auth(string callbackUri)
 {
     _client.CallbackUri = callbackUri;
     return(_client.GenerateAuthenticationUri());
 }