Git Product home page Git Product logo

Comments (2)

ceee avatar ceee commented on September 17, 2024

I do not know where you have this code from, but this is dead wrong.
You are introducing deadlocking issues by calling .Result on the public async methods of PocketSharp.
Same goes for your infinite loop where you are calling GetUser.

The reason why your code is launching the browser is because this is the default when calling Process.Start with an URL as the parameter.

There is no way to authenticate a user without presenting a web form, as the user has to authenticate your application within the Pocket context (on getpocket.com).

I have documented the authentication process here: https://github.com/ceee/PocketSharp/wiki/Account-Authentication

from pocketsharp.

derekantrican avatar derekantrican commented on September 17, 2024

I understand that what I'm doing is probably not great, but if I do this:

public static async Task AuthPocket()
{
    PocketClient = new PocketClient(ConsumerKey);
    PocketClient.CallbackUri = "https://getpocket.com/a/queue/"; //Todo: prevent this from opening
    string requestCode = await PocketClient.GetRequestCode();
    Uri authenticationUri = PocketClient.GenerateAuthenticationUri(requestCode);
    Process.Start(authenticationUri.ToString());

    PocketUser user = await PocketClient.GetUser(requestCode);

    PocketClient = new PocketClient(ConsumerKey, user.Code);
}

I get PocketException: Pocket error: User rejected code. (158). Which is why I had added the while loop with a delay. Am I following the wiki page wrong?

from pocketsharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.