0.5.0 • Published 7 years ago

react-native-linkedin-oauth v0.5.0

Weekly downloads
7
License
MIT
Repository
github
Last release
7 years ago

React Native LinkedIn OAuth

A react-native component to get access token via OAuth 2.0.

Purpose

Get access token with the OAuth 2.0 solution.

Why not Mobile SDK?

According to the official documentation of Mobile SDK, the access tokens we get via Mobile SDK cannot be used on server-side REST API calls. And there is no mechanism available to exchange them. But sometimes we just want a access token which can be used on server-side, too!

If you just want Mobile SDK Integration, check react-native-linkedin-login or react-native-linkedin-sdk.

Documentation

LinkedInOAuth is the only component, it will show a webview which let user to login and grant access to your app, the access token will be passed through the callback. Check here to see the OAuth 2.0 process.

Reminder: It's just a component, you should wrap it up, provide a nice navigation bar with a close button.

Props

NameTypeRequired
redirectUrlstringYes
clientIdstringYes
clientSecretstringYes
statestringYes
scopeArray\<string>No
onSuccess(result: OAuthResult) => voidYes
onFail(error: OAuthError) => voidYes
onCancel() => voidYes

OAuthResult

NameType
accessTokenstring
expiresInstring

OAuthError

NameType
typestring
messagestring