/// <summary>
        /// Makes call for Access Token
        /// </summary>
        /// <param name="response">Response string containing 'code' token, used for getting access token</param>
        /// <returns></returns>
        private async Task <bool> Authorize(string response)
        {
            try
            {
                string   responseData = response.Substring(response.IndexOf("code"));
                string[] keyValPairs  = responseData.Split('=');
                string   code         = keyValPairs[1].Split('&')[0];


                string clientId = await AppCredentials.GetAppKey();

                string appSecret = await AppCredentials.GetAppSecret();

                var request = new OauthTokenRequest(clientId, appSecret, code);
                var token   = await client.Oauth.CreateAccessToken(request);

                if (token != null)
                {
                    client.Credentials = new Credentials(token.AccessToken);
                    await SaveToken(token.AccessToken, clientId);
                }
                return(true);
            }
            catch
            {
                return(false);
            }
        }
        /// <summary>
        /// Opens OAuth window using WebAuthenticationBroker class and returns true is authentication is successful
        /// </summary>
        /// <returns></returns>
        public async Task <bool> Authenticate()
        {
            try
            {
                string clientId = await AppCredentials.GetAppKey();

                OauthLoginRequest request = new OauthLoginRequest(clientId)
                {
                    Scopes = { "user", "repo" },
                };

                Uri oauthLoginUrl = client.Oauth.GetGitHubLoginUrl(request);

                WebAuthenticationResult res = await WebAuthenticationBroker.AuthenticateAsync(WebAuthenticationOptions.None, oauthLoginUrl, endUri);

                if (res.ResponseStatus == WebAuthenticationStatus.Success)
                {
                    var response = res.ResponseData;
                    return(await Authorize(response));
                }
                else
                {
                    return(false);
                }
            }
            catch
            {
                return(false);
            }
        }