Login to my webpage through google-chrome-extension with OAuth - oauth

I have situation where i got two sides working separatly
Webpage using OAuth to register/login user (and display his account data)
Chrome extension where user authentificates himself through OAuth (no my webpage involved yet)
So i can't figure out is how to connect extension to see user webpage data. See image below to understand better.
What are possible ways to get it work?
UPDATE:
One idea is:
give every user secret key in their webpage account
And after they authorized in extension request for this secret key
on success, get data through my own written API
it could work, yes? maybe some improvents you can give or totaly different idea?

Related

Google OAuth is making call to Youtube API

I am trying to use Google OAuth2.0 for authentication. Everything is working fine but on initial(first) loading it is taking extra time (30 seconds-RequestTimeOut) on client side(Web-App) to load prompt. I've checked the Network Tab (Developer Console-Chrome), where I've found that it is trying to make call to
https://accounts.youtube.com/accounts/CheckConnection?pmpo=VALUE&v=VALUE&timestamp=VALUE.
This request is failing with ERR_TIMED_OUT, and In my organization we don't have access to Youtube (That I'm aware of it). But Why and Where my application is making request to Youtube API is my question. If so How do I stop this (fetch accounts from youtube)?
The scope of My App goes like this
"scope": "https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile"
It is happening on initial load itself, later it is giving 200 status for the same request. What am I missing.
I'm completely new to this. (Sorry, If it is noob question)
Thanks in advance.
Edit::
I came to know why it is making request to youtube api, It is trying to fetch any other accounts(login users) from youtube(gmail-accounts). But how to stop making request to youtube(accounts.youtube.com). It is fine for my application to fetch accounts from google(accounts.google.com).
Thanks.
Google puts an iframe inside google o-auth account picker.
Google oauth and youtube accounts iframe
Analyzing the javascript inside that iframe, we find some evidence that, this might be an approach to load youtube session, in order to get the userId for the current logged user in Youtube.
By creating an iframe, you get the normal context of opening an website, this is, you get access to session information.
And it's exactly what this is used for, proof:
//# sourceURL=/_/mss/boq-identity/_/js/k=boq-identity.AccountsDomaincookiesCheckconnectionJs.pt_PT.4FJ4-a_ocZ8.es5.O/d=1/ct=zgms/rs=AOaEmlHUdMtrscDWG6wHCiHHFunuI9afAg/m=base
if (window.parent && window.parent.postMessage) {window.parent.postMessage( google.checkconnection.getMsgToSend('youtube', 'some_id'), 'https:\/\/accounts.google.com');}</script>
iframes can communicate, as long as one another is listening to this messages.

Typo3: FE Login with POST Request to external app server

I recently started getting into Typo3 but now I have to implement something for work and I have no clue where to start.
The requirements:
I have to add a separate page that can only be accessed by frontend
users. (so far no problem)
These frontend users should be able to login with the same password
as they got for their iOS app. (uh-oh)
The separate page should display data from the app. (less of an uh-oh
but connected to the previous point)
After talking to the developer of the app, he made a specific POST request that can be used for the webpage. I am also getting a json-file with the required data that I need to display upon successful login.
My question lies with the login. How do I go about implementing this? I use the extension felogin to provide the login form on the page.
The POST request is looking sort of like this:
https://domain.at/api/queryMediaItems. It needs user and password, declared as user and pwd. In the body there should be a json object with the language, e.g.:
{"language":"de-at"}
You need to implement a SSO (SingleSignOn) as your users need to identify against the iOS-app.
This might give you a concept.
You also can look inside the code of some extension

Instagram api not returning any followers although response code is 200

I am using instagram to recieve the list of people i follow and although api returns the status code 200 I recieve absolutely no data.I tried using postman client instead of my code and even from there no data is being returned I am hitting the following service.
https://api.instagram.com/v1/users/self/follows?access_token=token
one thing to be noted is my application is in sandbox mode and this same access token is working and fetching other information about the user including media shared by the user and its basic information etc and user follows and is followed by several users.
Please suggest the solution thanks in advance.
I may have answer to this question since I was facing the same issue on my WinRT project yesterday.
You may need the relationship scope instead of 'follower_list' scope.
I am assuming that you have provided the scope as 'follower_list' in the authorization URL and logged in as yourself or through your own Instagram account(the same account with which you have created your Instagram app). And now if you are hitting the above service it will return nothing in data since you are requesting if the user is following you or not(so obviously you are not following yourself)!! So if you try logging in with someone else's Instagram account and hit the above service with follower_list scope it will return your Instagram account in data if the logged in person is following you.
EDIT
The above service will return all the users that are following you AND present in your sandbox users list. (Or at least that is my conclusion on this)
For further clarification try https://apigee.com/console/instagram for hitting this service there they are using the relationship scope.

Console application using the YouTube Data API

I'm about to build a console application that needs access to the authenticated YouTube Data API. Calling the API's themselves is not a problem, I know quite well how to make and process HTTPS requests.
I've already gotten the API key and the Client ID. No problems there, either.
The problem is the authentication.
I've checked here: https://developers.google.com/youtube/v3/guides/authentication#installed-apps
On the "Installed applications" tab, in step two, it instructs on how to set up a url to call to do the authentication step. All good so far. But before programming anything, I thought I'd try and see what that url does in the browser.
Turns out it just displays a login prompt. Well how about that. That won't work in this kind of console application. The idea is, presumably, that the user is somehow shown this webpage and be instructed to login and allow access. Then, somehow, by some kind of magic perhaps, the access token is sent back to my console application.
Two things I'm not quite sure about:
1) How do I prompt for the username and/or password in the console app and send that to the authentication URL?
2) How would I get the access token back from it?
The biggest problem is that the API seems to require a browser... Which isn't there. My console application will (eventually) run unattended, so starting up a browser and displaying a webpage and doing nothing until it returns a code, is out of the question. I need to somehow supply the authentication page a username/password and get back the code right away.

Twitter Oauth in windows phone 8 app

I need to use Twitter Oauth to login my windows phone app,
What i need exactly is
1)when the user click twitter log in button from my app, i need to show the twitter llog in page in a browser,
2)when he enters his credentials and accept the app, then i should get the user information like, name, gender, bday, what ever i can take.
That,s it, then i can close the browser and make my app active.
I just need to make the user to log in via twitter.
I referred lot of examples, that are all quit confusing and doing all the stuffs in twiiter.
I tried this example
and got this error
'TweetSharp.TwitterService' does not contain a definition fError 2 'TweetSharp.TwitterService' does not contain a definition for 'GetAccessToken' and no extension method 'GetAccessToken' accepting a first argument of type 'TweetSharp.TwitterService' could be found (are you missing a using directive or an assembly reference?)
and i tried enter link description here
failed on that too.
Can anybody help me to do the authentication via twitter for my app.
Thank you.
I tried this example and got success, I contacted the person who have posted that example and got help from him to solve the issues raised from this example.
Actually this Example works fine for twitter integration,
What you have to do is
1)Register your app in twitter, here the link for app registration,
log in and register your app.
2)Make sure you have given the Call Back URL(i forget to give that, and that makes me face lot of issues)
3)Note down the Consumer Key, Consumer Secret and Call back url(we need specify this 3 in our code)
4)Go to Settings, and set your app access to Read and Write
5)down load the above link and change the Consumer Key, Consumer Secret and Call back url as per your app, and then run the example, it will work fine.
Thank you.
If you just want to authenticate using Twitter and don't want to post anything, perhaps you can try Azure Mobile Service Authentication. You can find more information here: mobile services authentication

Resources