can I get access token through LinknedIn JS SDK? - linkedin

new to LinkedIn OAuth development, I want to use its JS SDK to implement login, but I can not find a way to get the access_token after I login successfully.
Does LinkedIn JS SDK has some API to get it ? Just like facebook javascript api does.
Thank you !

Related

Xamarin.Forms WebAuthenticator and Google

I have been trying now for a while to retrieve Google Calendar information from a google user in Xamarin.Forms.
I started my journey using Xamarin.Auth but I could not get past an issue where after a login the CustomTab in my Android App would not close. Seems to have been an ongoing problem for years now and several people proposed hacks to get around this problem. I gave up on Xamarin.Auth at this point
So I tried to use Xamarin.Forms Web Authenticator to retrieve the calendar information. The documentation does not mention how to authenticate with Google so I tried this
var authResult = await WebAuthenticator.AuthenticateAsync(
new Uri("https://accounts.google.com/o/oauth2/auth"), // auth url
new Uri("packageNameOfMyApp://"); // redirect url
I am getting an invalid request error
How do I have to choose the first parameter of AuthenticateAsync to properly authenticate with Google?
Do I have to somehow encode the ClientId from my app I obtained after configuring my application login via the Google Developer Console?
It is not possible to use WebAuthenticator with Google. Google requires a web browser to do the authentication and does not permit your app to authenticate by itself. For the same reason, an approach where you use WebView in your app to navigate to the Google authentication site will fail

How can I use Firebase Auth token for YouTube API access token

I'm working on a React native application and want to use Firebase auth token for the YouTube API.
firebase.auth().signInWithEmailAndPassword(
credentials.email,
credentials.password
).then( ()=>{})
What is the right way to achieve this?
The Firebase Auth token is a JWT, which is not a valid OAuth2 token that can be used for the Youtube API. If you want to access youtube, you'll have to sign in there separately with their documented authentication flow.

Google calendar api authentication in Google Actions

I want to be able create calendar events in my Action that runs through Google Assistant.
Right now I was able to modify this Quickstart guide (https://developers.google.com/calendar/quickstart/nodejs) and use it in my current Dialogflow fulfillment. However, it's a little tedious to have the user have to copy and paste the authentication code after allowing Google Calendar access. Are there any better ways to do this that doesn't require the copy-paste flow? Thanks in advance!
Use Account linking with Google Sign-In
https://developers.google.com/actions/identity/google-sign-in
Then send a card to the user device with a link to authorise Google Calendar access. Store the authentication code securely against the user. Use the authentication code to make requests.
Broadly speaking, the approach you can take is to use Google Sign-In, as outlined in this SO answer: Google Home Authorization Code and Authentication with Google Account.
With this scheme, you use a website to get the user to authorize your use of the Calendar API scope, and you store the auth token against their UserID. Then you use Google Sign-In with the Assistant to get that ID. This works well if they go to your web page first, but not as well if they go to the Assistant first.
You can also setup an OAuth server that lets users sign-in using Google Sign-In on a web page (or use something like Auth0 and, as part of that sign-in, get authorization for the Calendar scope. Then use OAuth Account Linking in the Google Assistant to get an auth token which you can use to get the user's ID. You can then use this ID to lookup the authorization token.

Couldn't find my Api-key in my firebase console for my flutter project sign-up authentication

I'm new to flutter and trying to implement sign-up authentication in flutter using Firebase. But the problem is that when i learned about authentication, they provided a post method url which must accept API-KEY in it.
Now, i dont know where does my API-KEY exists.
http.post(https://www.googleapis.com/identitytoolkit/v3/relyingparty/signupNewUser?key=[API-KEY]');
You'll find it in Project Settings under the General tab.
If you add a web app, it's also the first parameter in the config.

Get Youtube access token after page reload with Firebase authentication

I want users to have access to their Youtube playlists after signing in with Google through Firebase. I use firebase.auth().signInWithRedirect(provider) for signing in and I can get their access token with firebase.auth().getRedirectResult() and everything works perfectly just after they signed in.
The problem is that I can't get their access token back if they refresh the page. Firebase automatically signs them in again but firebase.auth().getRedirectResult() returns
{user: null, credential: undefined, operationType: undefined}
I have tried the method used in Google's OAuth 2.0 Playground but I don't know where to get the authorization code used in step 2.
I'm grateful for any help.
Firebase doesn't provide a way to refresh a Google access token. Perhaps you are better off using Google web sign in SDK to obtain the Google access token: https://developers.google.com/identity/sign-in/web/sign-in
It also refreshes that for you automatically.
You can then pass the Google access token or ID token to sign in with Firebase:
firebase.auth().signInWithCredential(firebase.auth.GoogleAuthProvider.credential(googleIdToken, googleAccessToken));

Resources