Commit Graph

17 Commits

Author SHA1 Message Date
Martijn Walraven
f6b22fa10b Fix for a case where we have neither a public email nor user:email permission 2015-07-01 10:22:16 -07:00
Martijn Walraven
f32f07ab56 Use GitHub primary email only if public email not set 2015-06-30 15:34:32 -07:00
Simon Fridlund
c4bc118d00 Use GitHub account's primary email if the scope allows it
In the case when user or user:email scope wasn’t provided, use the
publicly visible email as before. In this case you can end up with not
having an email for GitHub accounts.
2015-06-30 15:34:32 -07:00
Simon Fridlund
3833be8bc1 Use primary email for the email field
The email provided by the user info in the response from /user is the
publicly visible email, which a user can choose to not set.

GitHub accounts always have a primary email, so let’s use that one
instead.
2015-06-30 15:34:32 -07:00
Simon Fridlund
7581cd398f Fetch emails from GitHub
This allows one to determine if an email is verified or not and also
gives you all emails the user have registered on GitHub
2015-06-30 15:34:32 -07:00
Andrew Wilcox
2fd00e58ba Implements the "redirect" login flow, for cases such as using a mobile
UIWebView which aren't able to use the preferred "popup" login flow.

See the specs for details:
  https://meteor.hackpad.com/OAuth-redirect-flow-spec-PeziTcaNPDP
  https://meteor.hackpad.com/OAuth-redirect-flow-part-II-vswwUKP4vXe

I extracted code to construct a URL from the `http` package into a new
`url` utility package.  The new package has no public API, it simply
has the original URL construction functions that were in `http` and
makes them available to oauth.

Fixes the Meetup account login, as Meetup now requires using
"https://api.meetup.com/2/members" instead of
"https://secure.meetup.com/2/members".

The `?close` parameter for the redirect URI is now not needed or used.
For backwards compatibility the `?close` parameter is included if the
login service configuration doesn't include the `loginStyle` field
(indicating it was created using old code).
2014-08-28 17:25:13 -07:00
Emily Stark
0c479a238b Add credential secret argument to retrieveCredential functions.
Fixes #2118.
2014-05-05 20:51:15 -07:00
Emily Stark
55363a9b86 Merge remote-tracking branch 'origin/devel' into awwx-oauth-encryption
Conflicts:
	History.md
	packages/facebook/facebook_client.js
	packages/github/github_client.js
	packages/google/google_client.js
	packages/meetup/meetup_client.js
	packages/meteor-developer/meteor_developer_client.js
	packages/twitter/twitter_client.js
	packages/weibo/weibo_client.js
2014-04-22 11:31:31 -07:00
David Glasser
8c38550315 Improve error message for pre-config login
Addresses #2048.

An earlier attempt (to wait for the config to load) ran into popup
blockers.

It would be nice to load the config statically with something like
Arunoda's fast-render. That said, even that's not good enough to allow
OAuth logins that bypass the popup blocker that aren't a result of a
user action, and for user actions it's easy enough to gate your login
button on `Accounts.loginServicesConfigured()`.

Longer term solutions include non-popup methods of OAuth login (see
Issue #438).
2014-04-21 13:39:36 -07:00
Andrew Wilcox
83af2e2179 oauth-encryption code review items
Have `OAuthEncryption.open` throw "decryption unsuccessful" on any
error to avoid allowing an attacker to break the encryption key by
observing the result of sending manipulated ciphertexts.

Add oauth-encryption and the oauthSecretKey config options to the docs
page.

Update history.

More documentation on functions.

Use `OAuth.sealSecret(...)` instead of `{seal: ...}`.

Rename OAuth._openSecret(s) to OAuth.openSecret(s).

In the readme describing how to generate a key, just use Node instead
of going through the hassle of creating a Meteor application.

Have the `oauth` package weakly depend on `oauth-encryption` for when
it's being used without accounts.

Add tips on using oauth-encryption without accounts to the readme.
2014-04-10 14:26:44 -04:00
Andrew Wilcox
d365f052f5 Encrypt account service configuration and OAuth secrets stored in the
database.

"Oauth" is renamed to "OAuth".  "Oauth" is kept as an alias for
backwards compatibility.

README.md contains a sample description of how to generate and use the
oauthSecretKey, which might be incorporated into the wiki
documentation page.
2014-04-08 18:57:58 -04:00
Tim Haines
723e4b5b50 Attach response object to accounts generated errors resulting from HTTP failures 2013-08-06 11:37:05 -07:00
David Glasser
a5c061ecde Rename Meteor.http to HTTP. Backwards compatible. 2013-07-25 18:54:42 -07:00
David Glasser
9f38258b54 Drop all @export lines. Add api.exportSymbol instead. 2013-07-25 18:54:40 -07:00
Geoff Schmidt
d2024ccee1 Clean up namespacing in accounts system too. 2013-07-25 18:54:40 -07:00
Tim Haines
a3f493bb79 Add retrieveCredential server methods 2013-05-17 21:01:14 -07:00
Tim Haines
107a06fd8c Extract github package from accounts-github 2013-05-17 18:00:35 -07:00