signin_with_linkedin 0.0.1 copy "signin_with_linkedin: ^0.0.1" to clipboard
signin_with_linkedin: ^0.0.1 copied to clipboard

A flutter plugin that helps to sign in with linkedin (Social sign in)

A Flutter package that helps to Sign in with LinkedIn

Overview #

Getting started #

Create an app on LinkedIn #

  • Go to the My Apps and click on Create app.
  • You need to verify the created app by tap on verification link by login to the company account of LinkedIn.
  • After that, refresh the Settings tab. you should see Verified with the date in App Settings.
  • Inside the Auth tab, set the Authorized redirect URL for the app.
  • Inside the Products tab, Request access for Sign In with LinkedIn using OpenID Connect

Usage #

  • Replace the below values
// Modify the "scope" below as per your need
  final _linkedInConfig = LinkedInConfig(
    clientId: '<<CLIENT ID>>',
    clientSecret: '<<CLIENT SECRET>>',
    redirectUrl: '<<REDIRECT URL>>',
    scope: ['openid', 'profile', 'email'],
  );
  • Call the signIn method.
  • onGetUserProfile is required to get user profile data.
  • Set onGetAuthToken callback if you want to use access token related data.
SignInWithLinkedIn.signIn(
    context,
    config: _linkedInConfig,
    onGetAuthToken: (data) {
        log('Auth token data: ${data.toJson()}');
    },
    onGetUserProfile: (user) {
        log('LinkedIn User: ${user.toJson()}');
    },
    onSignInError: (error) {
        log('Error on sign in: $error');
    },
);
  • Logout from the account
await SignInWithLinkedIn.logout();

Sign in button #

  • We have not provided any button/widget for Sign in with LinkedIn. You can create your own UI for the sign in button.
  • You can download button image from Image Resources