Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Program.cs it doesn't go over #5

Closed
Luke1978mi opened this issue Mar 2, 2018 · 5 comments
Closed

Program.cs it doesn't go over #5

Luke1978mi opened this issue Mar 2, 2018 · 5 comments

Comments

@Luke1978mi
Copy link

Luke1978mi commented Mar 2, 2018

Hi,
Your script:

            var oAuthConsumerInformation = new OAuthConsumerInformation("aaa", "bbb");
            var discogsClient = new DiscogsAuthentifierClient(oAuthConsumerInformation);

            var aouth = discogsClient.Authorize(s => Task.FromResult(GetToken(s))).Result;

            Console.WriteLine($"{((aouth != null)? "Success": "Fail")}");
            Console.WriteLine($"Token:{aouth?.TokenInformation?.Token}, Token:{aouth?.TokenInformation?.TokenSecret}");

Print Fail and exit. I am sure that user key and secret key is correct.

Why this script not respond success?
How i can execute some request in discogs DB?

Thank you so much.

@David-Desmaisons
Copy link
Owner

You should not inform your token here.

@Luke1978mi
Copy link
Author

You should not inform your token here.

Modified

@David-Desmaisons
Copy link
Owner

Well it means that the token you informed is not valid. You have to provide user key + secret key + token

@Luke1978mi
Copy link
Author

Luke1978mi commented Mar 2, 2018

        private static string GetToken(string url)
        {
            Console.WriteLine("aaaaa");
            Process.Start(url);
            string tokenKey = Console.ReadLine();
            tokenKey = string.IsNullOrEmpty(tokenKey) ? null : tokenKey;
            return tokenKey;
        }

Is here to set token? Where?

@Luke1978mi Luke1978mi changed the title Program.cs does nothing Program.cs it doesn't go over Mar 2, 2018
@David-Desmaisons
Copy link
Owner

Console.ReadLine();
You should enter the token in the console.
Process.Start(url); opens the browser so that you can identify and get the tpken value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants