Comments (2)
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.
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)
- WP7 crash HOT 4
- Null reference when sending actions
- Feature Request: JSON on Returned Models HOT 11
- Getting articles changed since some timestamp does not seem to work HOT 3
- Why is ID string? HOT 2
- Getting user info after login HOT 6
- Provide sample code for desktop application? HOT 1
- Support WebAuthenticationBroker view HOT 2
- System.StackOverflowException when testing PocketItem for null HOT 2
- Raw Json property on PocketItem HOT 4
- Expose Since property received from pocket server for Retrieve response. HOT 3
- PocketItem Equals method is broken HOT 5
- Migrate to Automatic Package Restore
- Serialization Problem [InvalidCastException]
- Make PocketSharp .NET Standard 2.0 compatible HOT 1
- version 5.0 add problem HOT 3
- Create .NET Framework version HOT 1
- Getting empty item titles HOT 4
- Getting 'System.InvalidOperationException: Current error context error is different to requested error' when adding an item HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pocketsharp.