Use Linkedin API to retrieve my profile info - javascript

I am developing my personal website and I want to retrieve my profile info on my Linkedin account by using the Linkedin API, so whenever I update on Linkedin, my personal website will be updated automatically as well. But this service needs to gain the OAUth2 token by logging in. How I can login (or gain OAuth2 token) from code-behind with my username and password, instead of manually login every-time? Prefer using JavaScript (client-side) or Python (server-side)

It looks like you need to use your username and password to obtain an Authentication key with LinkedIn. After authenticating yourself, you should be able to work with the API.
You can find information on how to do this here (link)

Related

Can Custom Authentication be made in Firebase

I am trying to use a 6 digit code to log-in a user.
The code is available for 20 seconds and is unique to every user.
Briefly explained:
User is already logged in on a mobile app
User press the button "Get Unique Code"
Then, user enter the code on a WebPage on his PC
If the code is correct, show data for that user
What am I asking is if there is way to properly authenticate the user who introduces that code correctly given that I have the userID and all the informations about the user?
I can try and "fake log-in" (display all the information for that user when the code is correct) but there are some issues with this and I would like to avoid it.
I am using Firebase Authentication and Firebase Firestore. JavaScript is used for Web.
You can implement any authentication scheme you want by creating a custom provider for Firebase Authentication.
See Authenticate with Firebase in JavaScript Using a Custom Authentication System and Creating Custom Tokens with the Admin SDK.
In this flow you:
Sign in the users yourself.
Create a custom token for those users in a trusted environment, such as a server you control, or Cloud Functions.
Pass that custom token to Firebase Authentication, which can then use it to identify the user, and secure access to Firestore, Storage, and Realtime Database.

Get user Access Token from Twitter in Angular 2+ app

Hi I want to get a twitter user access token/refresh token so that My application can post/read tweets on behalf of the user..
I have a button in my app.. on clicking of the button, I need to show something like below image -
user should be able to provide his/her credential and if it is already logged in to twitter then he/she should only see authorize app button..
I created a new app in my developer twitter account.. but little clueless on how to get user's access token to post/read behalf of him...
Twitter uses OAuth1.0a unlike Facebook which uses OAuth2.0. The difference between OAuth1.0a and OAuth2.0 is that OAuth1.0a is more secure and you should use a server-based authentication flow because it involves api keys and secrets which we shouldn't be sharing with angular app.
On server side (NodeJS/Django, etc) you should use a client library for OAuth1.0 which will help you in complicated process of signing requests befores sending it to twitter.
Here is a useful link (which I also used) for you to implement the server flow:
https://github.com/requests/requests-oauthlib/blob/master/docs/oauth1_workflow.rst
Basically, the OAuth flow for twitter is as follows:
Send a POST request to oauth / request_token
You will get the authroization url from Step 1 like this https://api.twitter.com/oauth/authorize?oauth_token=XXX which you will redirect the user to so that they can authorize your app
Twitter redirects the user to your redirect url (which you sent with the request in previous step) with access_token and verifier.
You need to exchange the access_token and verifier for the actual usable user access token by sending a POST to oauth/access_token.
You can find more details for 3-legged OAuth flow here: https://developer.twitter.com/en/docs/basics/authentication/overview/3-legged-oauth

Extract data using Google Analytics API without login gmail account

I am using Googe Analytics API. I had successfully configured google analytics api and get successful data but issue is that when I use any other email account to login and view the page, it says authentication issue.
I want to access analytics api without gmail login. I will hard code credentials to for login, but how to do it with javaScript?
How to get analytics data without login in api?
So if I am correct, you want to retrieve data from a Google specific account without having to log in or sign in that account.
You could use tokens to connect the API rather than manually log in (if that is what you are referring). Other options could be extracting the data into a virtual repository that you can use for presentation layer on the client side so you don't have to deal with credentials or security flaws on having to log in or hard code the authentication.
This should be do-able on javascript and jquery to make your data viewable.
To query GA without authenticating each time you will need obtain and store the refresh token while authenticating GA.
(not sure if we can retrieve refresh token with Js)
Once we have refresh token we can query API for access token again.

Facebook Javascript SDK Autologin & Tokens

I am using the Facebook login as an authentication for my PhoneGap application - once a user logs in, their data is retrieved from my database to display information. I am not using the SDK for any other purpose.
I have the Facebook auto login working fine - it retrieves an authResponse and my Facebook information. Since the access token changes with each login, what can I use to store locally and in my database to authenticate the user on my server for future logins?
Here is a flow that I think could work...
User sees logs in screen and enters Facebook credentials
Facebook securely validates and returns user information & access token
The app uses localStorage to store user email and access token
For future autologin, the localStorage values are used as email/password
I feel like this cannot be the correct answer, however.
I figured out a solution - I was confused about storing passwords on my database to fetch user information. Rather, these are the correct steps:
Use Facebook SDK to handle the login and retrieve the authResponse
Update the user table in my database with the temporary access token and retrieve user's information
For every POST or GET the user wishes to perform, I will match the FB.getLoginStatus() results from the database's access token (the check will be done server side)
If the tokens match, perform requests. Otherwise, force the user to login again.

Obtain user profile picture/badge for the signed-in google user

My web application uses google user-id for authentication. How do I fetch the currently signed-in user's profile picture/badge in javascript?
Note: I only have the access to the user's email address and id. I don't have the profile id.
Sounds like you're using the Users API, which doesn't offer access to profile info: Access to user's name and profile picture in the AppEngine's app.
Depending on which kind of users your app is dealing with (any gmail user, Google Apps users, Google+ users, etc) using other APIs could be attempted instead: Google+ API, Directory API, etc.
Another possibility would be switching to some other authentication method offering access to profile info. See What is the difference between Google identity toolkit, Google OAauth and Google+ sign in

Categories

Resources