Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

and-end/linkedin-auth-client

Repository files navigation


LinkedIn Logo

LinkedIn auth client

A simple client for authentication using LinkedIn.

npm latest version npm weekly downloads Maintainability code style: prettier License: CC BY-NC 4.0

Installation くろまる Usage くろまる Contributing くろまる Versioning くろまる Authors くろまる License

Installation

$ npm install @and-end/linkedin-auth-client

Usage

import fetch from 'node-fetch';
import LinkedInAuthClient from '@and-end/linkedin-auth-client';
const config = { fetchProvider: fetch };
const params = {
 client_id: 'xxxxxxxxxxxxxx',
 client_secret: 'xxxxxxxxxxxxxxxx',
 redirect_uri: 'https://example.com/auth/linkedin',
 scope: ['r_liteprofile', 'r_emailaddress'],
 response_type: 'code',
 grant_type: 'authorization_code'
};
const linkedInAuthClient = new LinkedInAuthClient(config);
linkedInAuthClient.init(params);
const authorizationCode = 'xxxxxxxxxxxxxxxxxxxx';
const data = await linkedInAuthClient.getAccessToken(authorizationCode);
console.log(data); // => { access_token: 'xxxxxxx', expires_in: '5184000' }

See how to request an authorization code in test/devServer.ts

Api reference: https://docs.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow?context=linkedin/consumer/context#step-2-request-an-authorization-code

Contributing

Please read CONTRIBUTING.md for details on the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • Kacper Ochmański - Initial work, development - ochmanski

See also the list of contributors who participated in this project.

License

This project is licensed under the CC BY-NC 4.0 License - see the LICENSE file for details

About

A simple client for authentication using LinkedIn

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /