Oauth redirects to accounts.google - node.js

I use Oauth 2.0 to send e-mail on my site. I downloaded JSON from Gmail console and use it to send e-mail.
But when I try to send it, it opens https://accounts.google.com/o/oauth2/v2/auth/oauthchooseaccount page.
How can I use OAUTH on my site without redirect to accounts.google page?

Related

Is it possible to sign the pdf inside my app instead of redirecting to docusing

I am having the requirement where the already notification pdf sent to users by my app now I want just the user can sign that document inside the app only he should not be redirected to the docusign for signing
Yes, you can do that. You can embed the signing session (the URL you get form the API call) inside an iframe in your app. You will have to ensure that the browser allows iframes with cookies from "3rd parties" but it should work.

How to handle the authentication flow when using Google sign in in my Chrome extension

I am planning to use Google sign in for my Chrome extension. I came across the following docs:
https://developers.google.com/identity/sign-in/web/sign-in
From what I understand, clicking on the auth button opens up another webpage, and then if the user authenticates the app, then they are redirected back to the page. Now, what if I want to do this from my Chrome extension that can run on my webpage/domain. What would be the workflow for authenticating then using Google sign in?

Bot Framework Facebook Messenger Account Linking

Trying to implement account linking on FaceBook Messenger via Microsoft Bot Framework. This is what i did.
Hosted a Bot on botframework, which sends back a signin card.
var msg = new builder.Message(session)
.attachments([
new builder.SigninCard(session)
.text("Click below to Sign in.")
.button("Connect with Me", "https://6493.ngrok.io/login")
]); session.send(msg);
My idea is to eventually replace, https://6493.ngrok.io/login URL with a SSO backed web URL.
https://6493.ngrok.io/login is a sample node.js app, which has implementation for get->/login and post ->/login.get -> login , presents the user with a login form. accepts username/pwd.post ->login, when user submits on login form, i redirect to facebook messenger with an authorization_code and account_linking_token which is picked from the incoming query string.
Here is the issue i see.
When the connect button is clicked,
URL https://6493.ngrok.io/login is launched but it does not have, account_linking_token and redirect_uri as the
documentation mentions.
URL launches I dont have this information to send back a valid account_linking_token. I assumed that facebook wants a web based authorization url.

Show My Instagram Photos in My Website

Assume I have an Instagram account and a website. I want to display the most recent photos from my Instagram account on website. Something I am not clear in the documentation: in order to get my access_token I need to authenticate myself? I don't get how to do it in backend side. It works fine if I logged in as my account, but in incognito, there is a dialog pops up asking username and password. I don't want user to see that.
Do I need to provide my username and password in backend side and auto login? and I don't want to see the pop up dialog asking authentication. I need everything handled in backend side. How do I achieve it?
You can authenticate and get your access_token using the client implicit Oauth, you just have to open the auth url:
https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=token
setup a redirect-uri in your app settings, it can be http://localhost too.
opening above url in browser will show login page, once u login, you will be redirected to your the redirect-uri, the access_token will be in the redirect-uri:
http://localhost#access_token=ACCESS-TOKEN
copy the access_token
You can then make API call to get your own latest 20 photos and display on your website:
https://api.instagram.com/v1/users/{user-id}/media/recent/?access_token=ACCESS-TOKEN
You dont need to be approved by instagram, u can remain in sandbox mode and get latest 20 pics via API.

How can I add authenticated REST requests for my Node.js App which uses Passport JS based social login?

I have creating a website running on Node.js and Express. For logging into my website I use passport.js based social login with Google, Facebook and Live.
I need to expose user data via authenticated REST services so that website's Chrome & Firefox browser extension can do CRUD operations.
When user clicks on a button injected via browser extension, I need to check if user is already logged in to website. If user is not logged in then I will do a redirect for login and return back to original page.
I am clueless after this. Which token do I use for REST API calls ?
Any Advice ?
After the social login, when the user is redirected to the callback url, you can create your own token, e.g. using uuid, and then send it to the client.
For all the consequent requests the client needs to use that token for authentication and you have to manage its expiration.

Resources