Getting OAuth Tokens Without User Registration

I want to store the multiple access / update token in a separate document, but without running the OAuth built-in workflow.

I tried to manually make a request, but when I redirect back to my application, the route meteor oauth "highjacks" package fails and it fails.

I also tried redesigning the oauth meteorite packets, but they are very confusing.

Any advice or high level / detailed plan on how to do this?

+1
source share
1 answer

You should be able to set the OAuth redirect URI to what you want. At Google, when setting up a new customer ID, one of the fields is "Authorized redirect URIs."

screen show of Create Client ID

If you added a meteorite account package, remove it, as this may interfere. The basic steps to run OAuth are:

  • Create client credentials (client_id, client_secret) in the control panel for the OAuth provider. This will enable the redirect_uri setting.
  • Create the login url using client_id, client_secret and redirect_uri.
  • Deploy redirect_uri in your application to capture authentication code
  • Exchange authentication code for access token (and update token)
  • If the access token expires, get a new access token using the update token

Here is a blog post with more details:

http://blog.philcruz.com/2015/05/manually-getting-oauth-tokens-in-meteor.html

Here is an example project that manually uses OAuth:

https://github.com/philcruz/meteor-gmail-example

+2
source

All Articles