Socket
Book a DemoInstallSign in
Socket

@startupjs/auth-linkedin

Package Overview
Dependencies
Maintainers
6
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@startupjs/auth-linkedin

LinkedIn auth plugin for StartupJS auth module

latest
npmnpm
Version
0.55.11
Version published
Maintainers
6
Created
Source

Authorization via Linkedin

Init main module

Configuring main module

Requirements

@startupjs/auth: >= 0.33.0
react-native-webview: 10.10.2

Setting up app

1 - Create a software application link 2 - In the Auth tab, copy Client ID as LINKEDIN_CLIENT_ID, Client Secret as LINKEDIN_CLIENT_SECRET 3 - Add links for redirects, on tab Authorized redirect URLs for your app: http://localhost:3000/auth/linkedin/callback http://localhost:3000/auth/linkedin/callback-native 4 - In Products tab, select Sign In with LinkedIn

Init on server

Importing strategy:

import { Strategy as AzureadStrategy } from '@startupjs/auth-azuread/server'

Importing lib for config:

import conf from 'nconf'

In startupjsServer, in the strategy of the initAuth function need to add LinkedinStrategy:

initAuth(ee, {
  strategies: [
    new LinkedinStrategy({
      clientId: conf.get('LINKEDIN_CLIENT_ID'),
      clientSecret: conf.get('LINKEDIN_CLIENT_SECRET')
    })
  ]
})

Dynamic initialization of the strategy is also available, which occurs every time directly at the moment of user authorization.

initAuth(ee, {
  strategies: [
    new LinkedinStrategy({
      getClient: async function(req) {
        // ...
        return {
          id: '######',
          secret: '######'
        }
      },
    })
  ]
})

Init in layout

import { AuthButton as LinkedinAuthButton } from '@startupjs/auth-linkedin/client'

FAQs

Package last updated on 22 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts