Giter VIP home page Giter VIP logo

react-linkedin-login's Introduction

React Linkedin Login

Caution

This repo has been archived since the login API used by this repo has been deprecated. https://www.linkedin.com/developers/news/featured-updates/openid-connect-authentication

.github/workflows/workflow.yml

A simple app to demo LinkedIn login using LinkedIn OAuth 2.0

Screenshot

React Linkedin Login Screenshot

Demo

https://tony-linkedin-login.azurewebsites.net/

Usage

Clone

git clone https://github.com/tonyxu-io/React-Linkedin-Login.git

Install Dependencies

Install dependencies for server

cd React-Linkedin-Login
npm install

Install dependencies for client

cd client
npm install

Get LinkedIn App Credential from LinkedIn Developer Portal

  • client_id
  • client_secret

Configure 'http://localhost:3001/callback' as Oauth2.0 redirect uri

Create Environment Variables

/React-Linkedin-Login/.env

EXPRESS_APP_CLIENT_ID=${Your-Client-ID}
EXPRESS_APP_CLIENT_SECRET=${Your-Client-Secret}
EXPRESS_APP_REDIRECT_URI=http://localhost:3001/callback

/React-Linkedin-Login/client/.env

REACT_APP_CLIENT_ID=${Your-Client-ID}
REACT_APP_REDIRECT_URI=http://localhost:3001/callback

Build Client

/React-Linkedin-Login/client:

yarn run build

Start Server

/React-Linkedin-Login/:

PORT=3001 npm start

Visit http://localhost:3001/ in your browser.

Consumed SDK/API

Changelog

  • Mar 1, 2020: Migrated hosting platform from GAE to Azure, and CI/CD platform from Travis CI to GitHub Actions
  • Jan 20, 2019: Migrated JS SDK related API usage (due to deprecation of LinkedIn JS SDK) to REST API
  • Aug 1, 2018: Removed summary check in case user doesn't have summary content
  • April 2, 2018: Created first version using JS SDK to load profile

Disclaimer

This is not an official sample app or documentation from LinkedIn. Please refer to LinkedIn API Documentation for official documentation and sample apps.

react-linkedin-login's People

Contributors

danon avatar dependabot[bot] avatar tonyxu-io avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

react-linkedin-login's Issues

demo doesn't work

shows this error The redirect_uri does not match the registered value

"Bad request" error

When clicking on the "Allow" button in the authorization popup, the popup gets blank and "bad request error" is displayed . This occurred in the demo site.

Auth error

Hi,

I am getting authentication error while using the app. Ami missing something. Secreenshot added below

image

Very hard bug to find

I was reciving "Bad request" everytime I wanted to get /accessToken, without any error message whatsoever from linkedIn api.

The reason: the redirect_uri was different for authorization and for access token.
Reason for that: I've set my custom URL in .env for redirect_api, but because of the "proxy": "localhost:3001" in package.json it was still taken into account.

So my idea is:

  • Don't suggest using .env, for custom hosts
  • Remove "proxy" entry from package.json

Because you can't use both anyway :D

Dialogue is not closed after login

Hi @tonyxu-io ,
I have set the redirect URL = "http://localhost:3000/callback" but dialogue not closed automatically.
Capture

Const redirect_url = "http://localhost:3000/callback"
var oauthUrl = `https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=${client_id}&scope=r_liteprofile&state=123456&redirect_uri=${redirect_url}`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.