Dart and OAuth problems

118 views
Skip to first unread message

Daniele Scasciafratte

unread,
Oct 16, 2014, 4:31:37 PM10/16/14
to mi...@dartlang.org
Dart and OAuth problems

I've a problem with the oauth2 package (not the google version) in my CLI app.
As you see in https://github.com/Mte90/FMStats/blob/master/lib/src/statistics.dart i'm tryng to open an OAuth call to the Firefox marketplace.
The Marketplace release a secret token and a key but I can not make the call.
I get this error with the correct secret/key: http://pastebin.com/zVvAemFC
The secrect/key are correct and not are expired.

Dartisans post: https://plus.google.com/u/0/112897312156913513724/posts/C29nFQygnC1

Günter Zöchbauer

unread,
Oct 16, 2014, 4:47:31 PM10/16/14
to mi...@dartlang.org
I have not much experience with OAuth2 - just a few thoughts:
Shouldn't you get the expiration time from the server somehow?
Why do you think DateTime.now() - 1h is what the server wants?
You could try to add toUtc()

Daniele "Mte90" Scasciafratte

unread,
Oct 16, 2014, 5:11:47 PM10/16/14
to mi...@dartlang.org
I've followed the example of the package for the code.
I think that the problem is not this :-/
--
For other discussions, see https://groups.google.com/a/dartlang.org/
 
For HOWTO questions, visit http://stackoverflow.com/tags/dart
 
To file a bug report or feature request, go to http://www.dartbug.com/new

Bob Nystrom

unread,
Oct 23, 2014, 1:24:36 PM10/23/14
to General Dart Discussion, Natalie Weizenbaum
+nweiz

Adding Natalie, who maintains that package, to the thread.

- bob

To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.

Natalie Weizenbaum

unread,
Oct 24, 2014, 3:45:20 PM10/24/14
to Bob Nystrom, General Dart Discussion
You can't just construct your own authorization credentials from scratch. You need to use the AuthorizationCodeGrant API to get authorization from the remote server.

Daniele Scasciafratte

unread,
Oct 29, 2014, 3:04:11 PM10/29/14
to mi...@dartlang.org, rnys...@google.com
The Mozilla marketplace release only two keys the key and the secret key.
In the docs is not explained this part:

final authorizationEndpoint =
    Uri.parse("http://example.com/oauth2/authorization");
final tokenEndpoint =
    Uri.parse("http://example.com/oauth2/token");

In the examples of the mozilla marketplace the reference is:
echo '{"marketplace.firefox.com": {"key": "other key", "secret": "key"}}' > .curling
curling https://marketplace.firefox.com/api/v2/account/settings/mine/

So i don't understand the use of AuthorizationCodeGrant API.

Thanks for the help

Natalie Weizenbaum

unread,
Oct 29, 2014, 5:21:37 PM10/29/14
to General Dart Discussion, Bob Nystrom
Reply all
Reply to author
Forward
0 new messages