Rails / Omniauth Google API - refreshing a token - ruby-on-rails-3

This one is a little above my pay grade, so hopefully someone here can help!
I'm using the https://github.com/zquestz/omniauth-google-oauth2 gem along with Omniauth in a Rails app. A user can successfully connect through Google and grab the permissions I need. It then returns the Auth and Refresh tokens, which I am storing.
My issue is, I can't figure out how to refresh the token when it expires. This is detailed in-depth in the documentation:
https://developers.google.com/accounts/docs/OAuth2WebServer#offline
But I cannot for the life of me figure out how to use Omniauth to check if the current token has expired, request a new one using the refresh token if so and store it.
Thanks in advance!

Related

Tiktok authentication for using api

Can anybody tell me that is it necessary that tiktok webapp should be approved for getting access token cuz my app is under reviewed and when I go to authentication page for callback authorization after login it is showing error
I followed all the instructions that were given in there documentation but i am stucked at the call back authorization
The status of your app should be Live in production. They usually give you feedback if there are any issues and in case it's declined. You have to make fixes accordingly to get the API functionality to work.
The reviewal process shouldn't take longer than 3 working days.

Google Authentication via PHP Client Library/oAuth2

I have searched long and far for this on Google Identity documentation but my question seems to be out of it's scope (https://developers.google.com/identity/protocols/OAuth2).
This is what I have:
I have an app that is using Google's PHP Client library to authenticate a user via oAuth2. My application stores the retrieved token & refresh token from a user. I am able to use this token and refresh token to pull in information from various Google API's (Drive, Calendar, Mail, etc). I am also storing a cookie in browser to keep the user logged in to the application when the user closes the browser. I have created a simple way for users to login to the application via a QR code that matches up their stored token and refresh token. After the first login they are able to simply use a badge to login to the application.
This is what I want but don't know how to do
When a user logs into the application with their QR badge everything work perfectly (I am still able to pull in anything via the PHP Client Library/Google API's), however when a user goes to Gmail, Drive, or other Google service, Google is asking them to login (it's because they are not technically authenticated with accounts.google.com (only my application)). Is there a way to programmatically authenticate a user to accounts.google.com via a stored token/refresh token?
I was searching for a proper way to implement authentication of users with Google accounts into an app I'm developing. One thing led to another and I found this:
https://github.com/thephpleague/oauth2-google
They have a few implementations depending on how you may wish to implement OAuth2 (via separate repositories). I believe this directly answers your question, albeit 3.4 years later. Hopefully it will help someone else who is looking for this info.

Get Facebook user basic info without authorization

I want to be able to show a user which of their friends have signed up for the app as soon as they come to the site, before they are authorized, as long as they are logged into Facebook in the current browser.
Is this request possible? I have definitely seen this sort of thing, but I am not sure if this is universally available. I recall seeing some info on this topic on Stackoverflow, but cannot find it at the moment.
It's a Ruby on Rails app and I have been using Koala to make the authorized requests.
Thanks.

Twitter Connect Get Auth Code Without Refreshing the Source Page

Is there any way with Twitter to get the auth code without having to go through Twitter and being redirected back to the source page ( my website ) ?
I am aksing this because we need to connect the user to Twitter, but without refreshing the current page the user is on.
Is this possible with Javascript, jQuery or whatever?
PLease help me out.
Thanks
Using whatever, Python and Java in this case. I ran into this article a few days ago you'll find interesting:
Automated Browserless OAuth Authentication for Twitter
quote from the article:
This article describes how to use the OAuth 3-legged protocol with a
headless browser like HtmlUnit to get tokens from twitter without user
intervention.

iOS 5 Twitter framework. Getting OAuth access token for user

Has anyone been able to get the OAuth access token for a user after being granted access to that users account?
twitter mentions using a process called "Reverse Auth" in there iOS docs, but I can't seem to find any mention of it anywhere else.
I'm feeling a little lost here so if any one can provide some inside it would be much appreciated.
More information on using Reverse Auth has been released by Twitter here.