I am integrating google drive files docs,spreadsheets and preasentations with my app. I need some help about alternate link.
Files.get api includes a link called "alternateLink" which opens users file with compatible editor. But when i forward user to link if user is not logged in, google shows login screen before. I am asking about how can i overcome with login screen using OAuth2 mechanizm. Should i set a cookie or smt else ?
Thanks
The AlternateLink will always require that the user is signed-in his Google Account. If you want to use this you will have to share the document publicly which won't require sign-in then.
To use OAuth 2.0 you will have to use the 'downloadUrl' you can append the OAuth 2.0 access token to the downloadUrl like this:
authorizedDownloadUrl = downloadUrl + '&access_token=' + accessToken
Beware that the download URL expires after 24h.
Related
I have set up my project to sign in to a user's Google account using the Google Sign In framework. It works fine, but I want to use the access token that I get from the sign in to access the user's Google Drive. I am programming for iOS and have already set up the Drive SDK in my project. I feel like there should be a simple way of doing this. Thank You!
Recently experienced the same problem myself when attempting to use the Calendar API.
You can access the access token (and therefore use it in your URL Requests) like so:
if (GIDSignIn.sharedInstance().currentUser != nil) {
let accessToken = GIDSignIn.sharedInstance().currentUser.authentication.accessToken
// Use accessToken in your URL Requests Header
}
Make sure to only call this method after the user has signed in, the check for current user will prevent a crash from implicitly unwrapping a nil value.
I have a requirement in my project like this .
Client will place a images in his google drive account/dropbox.I need to display those images in my application from drive/dropbox.I need to give client's credentials in the code by static.So is there any way so that I can use dropbox without login or some where I can set default login ID Password and automatically do login.
I'm not sure it gets possible.Can any one give me a suggestion.Is it possible with google drive or dropbox or box or any one without using server .
The Google Drive API does not support username and password as credentials. You must use OAuth2:
https://developers.google.com/drive/ios/auth
That said, you could get a refresh token once, store it in your app, and use that to generate access tokens to be used in the requests.
I want to implement social media log-in feature to my site where I have to allow users to use their existing Google or Facebook credentials to log-in to my site.
I read some articles and found learned that for Google log-in, I need to use Google+ API. So I added some Javascript and HTML code in my HTML page and tried to log in but I am getting following error.
401. That’s an error.
Error: invalid_client
Application: mytestapplication
You can email the developer of this application at: shekhar#gmail.com
no registered origin
I tried to create new OAuth ID but already there are too many IDs and I am not able to delete any one of them. I have tried all the client-id present for this application but none of the client-id is working.
Can anyone please tell how do I implement sign-in with google feature? How to delete and create new client-id?
The last line is important:
no registered origin
On the API Credentials page, click Edit Settings under the Client ID for web application section. Put your URL there (http://example.com).
I have Oath working with Facebook, Google, and Twitter; however, I am having an issue with the latter where it uses an "authorization" URL each time rather than "authentication". The result is that the user is asked to authorize my app each time. With both Google and FB once the app is authorized they are not asked again when they log in. It is aware behind the scenes if the user is logged into one of those services and if so (and they already authorized my app) it logs them immediately into my app. With Twitter it will take them to an authorization screen each time.
I know this is due to the flow I have with Twitter which which says: redirect_url = auth.get_authorization_url() followed by a self.redirect(redirect_url)
The key above is "authorization" which is unaware of the user's acceptance of my app previously. In Twitter I know there is a checkbox to "allow this application to be used to sign in with Twitter". This is checked. What I am not able to find is the correct path with Tweepy that checks whether the user is already logged into Twitter and has already authorized my app.
I do save the tokens that Twitter sent back with the user at first authorization, however, I have no idea who the user is until they login so I cannot try to use these tokens for this initial part of the exercise. I should note that I don't have to use the tokens from Google or FB either at this stage.
Can Tweepy be used in the manner described above or do I need to do something else?
Thanks!
Fortunately, there is a very simple solution. When calling api.get_authorization_url, simply specify signin_with_twitter=True as a keyword argument. Your call should look like this:
api.get_authorization_url(signin_with_twitter=True)
This causes Tweepy to use the 'authenticationendpoint you mentioned, instead of theauthorization` endpoint.
In my iphone app, I am having a twitter page where the user is entering his username and Password.Here, the problem is that I want to enter it from my own defined textFields like this example.How should I do it using SA_OAuth library.
http://www.youtube.com/watch?v=DkRTVFj6XaA.
Please Help and Suggest
Thanks
Prajnaranjan Das
The video you pointed to is about their old authentication mechanism, but you need to read up on their new authentication.
There is a twitter client that uses XAuth (instead of OAuth), which allows you to present native username/password fields:
https://github.com/st3fan/iphone-twitter
And a library for using OAuth itself with Twitter:
https://github.com/bengottlieb/Twitter-OAuth-iPhone
A newer, more comprehensive Twitter 1.1 wrapper for Objective-C:
https://github.com/nst/STTwitter