# Getting started with LINE Login

This page explains how to get started with LINE Login by deploying a simple starter web app. The web app lets users log in with their LINE accounts. You can use the access token issued when a user logs in to get the user's profile.

After completing all the steps on this page, you'll have a better understanding of how LINE Login works and how to build it into your web app.

# Before you begin

Before you can use the LINE Login starter app, you'll need the following:

Requirement Description
LINE account An account for the LINE app. To create an account, download LINE (opens new window), launch the app, and tap Sign up.
LINE Login channel A channel forms the connection between your app and the LINE Platform. Create a channel within the provider. You need to create a channel for each app. Create a LINE Login channel on the LINE Developers Console.
Notes:
  • If you've never logged in to the LINE Developers Console, you'll be asked to register as a developer first.
  • When creating a LINE Login channel to use a starter app, makes sure you select Web app under App types.
Heroku account Heroku (opens new window) is a service that offers free hosting for web apps. Deploying the starter app to Heroku means you don't need your own server.
Heroku CLI The Heroku Command Line Interface (CLI) (opens new window) is necessary for using certain Heroku functions.

# Step 1: Deploy the starter app

Have everything you need? Then start with these steps.

  1. Go to the line-login-starter (opens new window) repository on GitHub.
  2. In the README (opens new window), click Deploy to Heroku.
  3. Fill in the required information on the "Create New App" page in Heroku:
    • Heroku app name
      Must be unique. Suggestion: line-login-starter-{YYYYMMDD}
    • Region
    • Config variables
  4. Select Deploy app and confirm that your app is successfully deployed.

# Step 2: Create your LINE Login channel

A channel is the conduit through which your app connects to the LINE Platform.

Create a LINE Login channel in the LINE Developers Console for each of your web apps.

  1. Log in to the LINE Developers Console, select a provider, and create a LINE Login channel.

    Be sure to set the app type and callback URL for any LINE Login channel that you create for a web app.

  2. On the Basic settings tab, under App type, make sure that Web app is displayed.

  3. On the LINE Login tab, enter the Callback URL from Heroku (https://{Heroku app name}.herokuapp.com/auth).

The following information on the LINE Login channel settings is displayed to users:

Basic settings tab:

Items Display
Channel icon (optional) LINE Login, Permission consent screen of LIFF
Channel name Permission consent screen when you start LINE Login or LIFF
Channel description Permission consent screen when you start LINE Login or LIFF
Privacy policy URL (optional) Permission consent screen when you start LINE Login or LIFF
Terms of use URL (optional) Permission consent screen when you start LINE Login or LIFF

# Step 3: Try the app

  1. Browse to the URL of your app (https://{Heroku app name}.herokuapp.com). You should see this:

    LINE Login starter app login

  2. Click Log in.

    You'll be redirected to our standard login page. The URL starts with https://access.line.me/oauth2/v2.1/ and contains a number of query parameters. To learn what they mean, read Integrating LINE Login with your web app.

  3. Log in to LINE and agree to grant the required permissions to the app.

When you successfully log in with your LINE credentials, the app displays your LINE user profile image, display name, and status message. (If you're using an iOS or Android device and are already logged in to LINE, you'll be logged in automatically.)

# Try out the other features of the starter app

Once you have logged into the app, you can select the following buttons to try out other features of this app.

  • Verify the user access token
  • Refresh the user access token
  • Revoke the access token (log out)

# Check logs

Check your app's logs with Heroku CLI (opens new window).

  1. Log in to Heroku from the command line.

    $ heroku login
    
  2. Check the logs.

    $ heroku logs --app {Heroku app name} --tail
    

# Step 4: Customize your app

You can download the starter app to your local machine to test and make changes for yourself. You can then deploy the app to a web server of your choice. Here, we'll look at how to make and deploy changes to the Heroku app you created in Step 1.

Make sure you have these installed:

  • JDK 1.8 or later
  • Maven™ 3.0 or later
  • Git™
  1. Clone the line-login-starter (opens new window) GitHub repository.

    git clone https://github.com/line/line-login-starter.git
    
  2. cd into line-login-starter.

  3. Add a remote for Heroku to your local repository.

    $ heroku git:remote -a {Heroku app name}
    
  4. Make edits and commit changes (optional).

    $ git add .
    $ git commit -m "First commit"
    
  5. Push changes to Heroku master.

    $ git push heroku master
    

# Step 5: Publish your channel (optional)

LINE Login channels are created with "Private" status. With this status, only users with the Admin or Tester role (see Managing roles) can use the LINE Login channel. If you want to allow other users to access your app, you have to change the status of the app to "Published". To do so, open your LINE Login channel on the LINE Developers Console, and click the Private status at the top of the page.

If your current channel is for testing purposes only, you can leave the status as it is. But to make any future app available to users, you'll need to publish the channel that it's linked to.

# Next steps