linkedin_login 0.1.8 copy "linkedin_login: ^0.1.8" to clipboard
linkedin_login: ^0.1.8 copied to clipboard

outdated

Library for login with LinkedIn OAuth V2 service. This library helps you to implement authorization with LinkedIn OAuth API's.

linkedin_login #

  • A Flutter library for LinkedIn OAuth 2.0 APIs .

  • This library is using new way of authorization on LinkedIn

Installation #

Important #

You should replace this values

final String redirectUrl = 'YOUR-REDIRECT-URL';
final String clientId = 'YOUR-CLIENT-ID';
final String clientSecret = 'YOUR-CLIENT-SECRET';

Note: clientSecret field is required just for LinkedInUserWidget

To get these values you need to create App on the LinkedIn.

Samples #

You can see full example under this project.

Call LinkedIn authorization and get user object:

    LinkedInUserWidget(
       redirectUrl: redirectUrl,
       clientId: clientId,
       clientSecret: clientSecret,
       onGetUserProfile:
           (LinkedInUserModel linkedInUser) {
                print('Access token ${linkedInUser.token.accessToken}');
                print('First name: ${linkedInUser.firstName.localized.label}');
                print('Last name: ${linkedInUser.lastName.localized.label}');
       },
       catchError: (LinkedInErrorObject error) {
         print(
             'Error description: ${error.description},'
             ' Error code: ${error.statusCode.toString()}');
        },
    )

Or you can just fetch authorization code (clientSecret is not required in this widget):

    LinkedInAuthCodeWidget(
        redirectUrl: redirectUrl,
        clientId: clientId,
        onGetAuthCode:
            (AuthorizationCodeResponse response) {
                print('Auth code ${response.code}');
                print('State: ${response.state}');
            },
    ),

Properties that are available after call for LinkedInUserWidget #

  String firstName;
  String lastName;
  String accessToken;
  int expiresIn;
  String profilePicture;
  String email;
  String userId; (from version 0.1.)

Properties that are available after call for LinkedInAuthCodeWidget #

  String code; // authorization code
  String state;

Widgets #

Standard LinkedIn button for login. This widget is modifiable.

LinkedInButtonStandardWidget(onTap: () {});
65
likes
0
pub points
93%
popularity

Publisher

unverified uploader

Library for login with LinkedIn OAuth V2 service. This library helps you to implement authorization with LinkedIn OAuth API's.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, flutter_webview_plugin, http, uuid

More

Packages that depend on linkedin_login