コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: PocketApi.cs プロジェクト: yazdipour/githubx
        public async Task <Uri> LoginUriAsync()
        {
            client = new PocketClient(ApiKeys.Pocket, callbackUri: App.PocketProtocol);
            string requestCode = await client.GetRequestCode();

            return(client.GenerateAuthenticationUri());
        }
コード例 #3
0
ファイル: PocketAccount.cs プロジェクト: karkn/MochaRefs
 public Uri Auth(string callbackUri)
 {
     _client.CallbackUri = callbackUri;
     return(_client.GenerateAuthenticationUri());
 }