I have used Firebase to login to Twitter and generate token and secret that is needed auth in Twitter API (I think)
I have integrated Firebase with no errors and It works fine and returns both the values correctly.
Now I don't know how to implement these value and pass this token in twitter API. Please help with this (Javascript/React)
My problem is exactly this Same problem In PHP(from StackOverflow) except I used React instead of PHP and i have trouble understanding PHP code and implementing that logic to Javascript.
I also tried sending API request via Postman but I don't what fails.
You must pass headers and choose authorization.
You can use react-twitter-login package to get all tokens automatically, or look on codebase of it:
signature.ts - OAuth headers generation
oauth1 - OAuth 1.0 flow
Related
I'm currently working on an application for myself in which I need access to my own photos/albums on Google Photos. I have gotten by using the oauth 2.0 token generated in the playground, but I'd like to get a more permanent solution that does not require me manually regenerating the token. Is this possible with Google Cloud? The app is meant to run in daemon, so this makes any option with consent pages unusable. The scopes I'm using are:
https://www.googleapis.com/auth/photoslibrary.sharing
https://www.googleapis.com/auth/photoslibrary.readonly.appcreateddata
https://www.googleapis.com/auth/photoslibrary.readonly
I have tried using the https://accounts.google.com/o/oauth2/token and https://accounts.google.com/o/oauth2/auth endpoints to generate one programatically, but the only minor success I had was /auth sending me to a consent screen. I've also looked at using the refresh token given by Google Oauth playground with no luck there either.
Just looking to see if there is anything that I am missing.. This is my first post on stackoverflow, so please let me know if you need any more information.
I was unable to make it an internal app as it was for personal use and not for an organization.
Solved this by first using the google api package to create my own access/refresh token for my oauth client, then calling the https://oauth2.googleapis.com/token endpoint each time to generate a valid access token. I hope this can be helpful to someone else!
According to the setup documentation, as long as your app is marked as internal, you should not need to verify the app and can use it without the consent screen.
I'm working on my first react-native app, coming from vue-laravel background I was wondering if it's actually possible to use laravel normal auth for my react-native, so far it seems I can succesfully login a user sending their credentials via POST request to my API, however subsequent uses of Auth helper fail, that is I can't get the logged user using Auth::user(), it returns null...
Is this possible to accomplish? I have read about firebase auth but I don't feel like adding another database system to my laravel main Mysql database, truth is I don't know for sure what laravel uses for authentication under the hood so I can't get this to work.
Any help would be appreciated.
You can use tymon/jwt-auth for backend (laravel) and use the token in frontend(react native)
I keep getting in to a loop of only seeing google's OAUTH documentation when searching for this but I don't want any user interaction. Maybe it's not possible. I want to do something like the code below in a http GET like you do with the maps API and receive a JSON reply
https://www.googleapis.com/admin/directory/v1/users?domain=MYDOMAIN&maxResults=200&key=MYAPIKEY
When I try something like the above I get 401 login required. I'm using vue-resource to make the request if that is relevant.
If it is possible could someone post an example of a correctly formatted request?
Based on the documentation available at https://developers.google.com/admin-sdk/directory/v1/guides/manage-users you should be able to do this with a simple get request however it MUST be authorized with OAUTH 2.
As stated at https://developers.google.com/admin-sdk/directory/v1/guides/authorizing "Your application must use OAuth 2.0 to authorize requests. No other authorization protocols are supported."
I haven't used vue-resource before however I know that the Chrome plugin Postman has an authorization option to target OAUTH2.0 which should be a good place to start and perform a quick proof of concept.
Once you have the proof of concept working and understand how to interact with OAUTH you can look at implementing it in your app.
I want to get the id of a widget, because I need to pass it to a web service when the user saves the configuration. I have found out, there is a REST API service for this.
If I enter the following URL in my browser (substituting specific info in the brackets of course):
https://{account}.VisualStudio.com/DefaultCollection/{project}/{teamId}/_apis/dashboard/dashboards/{dashboardId}/widgets/{id}?api-version={version}
it works fine, however I get an HTTP 401 (Unauthorized) error when I try to make an ajax get request from the javascript code of the widget.
Any ideas?
You can try to create a personal access token and use it in your code.
Useful articles:
https://www.visualstudio.com/en-us/docs/setup-admin/team-services/use-personal-access-tokens-to-authenticate
https://www.visualstudio.com/nl-nl/docs/integrate/get-started/rest/basics
401 HTTP status means that you either are not authenticated with the API or are not authorized to perform a particular operation. TFS Rest API from what I can see allows two types of authentication:
Basic
OAuth
The documentation of the API at https://www.visualstudio.com/en-us/docs/integrate/extensions/overview explains it quite well and provides CURL commandline examples. Go and have a look.
For my current project i want to use Cloud Endpoints and Cloud Storage API at the same time.
When you authenticate for cloud endpoints the example tic-tac-toe app from Google states that one should set the access_token to be the id_token like this (see github repository):
var token = gapi.auth.getToken();
// Use id_token instead of bearer token
token.access_token = token.id_token;
However once the access_token is set to the id_token one cannot use the other google apis anymore. In my case the Cloud Storage API. The reason for this is that the access token is now invalid for them. For example, the cloud storage api returns Invalid credential.
Before the access_token is set to the id_token, the access_token looks like this: ya29.AHES6ZTjklghkljghlkjfghkljsrdölizuklhlfghI_UTfghdfghCg. It gets replaced with the id_token that i don't want to post here because it's really long.
The two solutions that i can think of are:
Copy the gapi object, each with a separate auth-object and token. Use the one with the id_token for cloud endpoints and the other for the rest (i was unable to copy the object in a way that makes this possible though)
Remember the auth token somewhere and replace it depending on what api (cloud endpoints / other api) i call (this would probably need synchronization and is somewhat messy)
I'm very interested in solutions and feasible workarounds for this problem.
If you encounter this issue, please read the answer below and my comments. Once you've done that you'll understand that this question is actually more this question here: How do I test Cloud Endpoints with Oauth on devserver
I'll leave the question here in case someone searches for the terms inside.
The Python Tic Tac Toe sample appears to be in need of an update. ID tokens are no longer required in this particular case. (The Java example is using Google+ login, so it has slightly different requirements.)
You can leave out manipulation of the token, and it will automatically work for Endpoints and whatever other Google API you are calling. See the Python "Hello Endpoints" example for what this looks like (most notable for what isn't in it).