GeeklistSharp.Service.GeeklistService.GetAuthorizationUrl C# (CSharp) Method

GetAuthorizationUrl() public method

public GetAuthorizationUrl ( string token ) : Uri
token string
return System.Uri
        public Uri GetAuthorizationUrl(string token)
        {
            return new Uri("http://sandbox.geekli.st/oauth/authorize?oauth_token=" + token);
        }

Usage Example

        public void GetAccessTokenAsyncTest()
        {
            string consumerKey = TestConstants.OAUTH_CONSUMER_KEY; // TODO: Initialize to an appropriate value
            string consumerSecret = TestConstants.OAUTH_CONSUMER_SECRET; // TODO: Initialize to an appropriate value
            GeeklistService target = new GeeklistService(consumerKey, consumerSecret);

            var requestToken = target.GetRequestToken();
            Assert.IsNotNull(requestToken);
            Assert.IsFalse(requestToken.Token == "?" || requestToken.TokenSecret == "?");

            var uri = target.GetAuthorizationUrl(requestToken.Token);
            Process.Start(uri.ToString());

            var verifyer = "5444526"; // <-- Debugger breakpoint and edit with the actual verifier

            AutoResetEvent waitHandle = new AutoResetEvent(false);
            OAuthAccessToken accessToken = null;
            target.GetAccessTokenAsync((at) =>
                {
                    accessToken = at;
                    waitHandle.Set();
                },requestToken, verifyer);

            if (!waitHandle.WaitOne(5000, false))
            {
                Assert.Fail("Test timed out.");
            }

            Assert.IsNotNull(accessToken);
            Assert.IsFalse(accessToken.Token == "?" || accessToken.TokenSecret == "?");
        }
All Usage Examples Of GeeklistSharp.Service.GeeklistService::GetAuthorizationUrl