A react-native component to get access token via OAuth 2.0.
Get access token with the OAuth 2.0 solution.
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.
yarn add react-native-linkedin-oauth
Yes, that simple!
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.
Name | Type | Required |
---|---|---|
redirectUrl | string | Yes |
clientId | string | Yes |
clientSecret | string | Yes |
state | string | Yes |
scope | Array<string> | No |
onSuccess | (result: OAuthResult) => void | Yes |
onFail | (error: OAuthError) => void | Yes |
onCancel | () => void | Yes |
Name | Type |
---|---|
accessToken | string |
expiresIn | string |
Name | Type |
---|---|
type | string |
message | string |