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 you log in with your LINE account. You can also access some functions of the Social API.

After completing this page, you'll have a better understanding of the parts and processes involved in integrating LINE Login.

tip iOS/Android/Unity starter apps

You need these things

Before you start, satisfy these requirements:

Requirement Description
LINE account An account for the LINE chat app. To create an account, download LINE, start the app, and click Sign up.
LINE Login channel A channel forms the connection between your app and the LINE Platform. Each app needs its own channel, with its own unique channel ID. Create a LINE Login channel in the console (requires a LINE account).
Notes:
  • If you've never logged in to the console, you'll be asked to register as a developer first.
  • Channels are grouped under providers. If you haven't created a provider, you'll be asked to do so.
  • When entering your channel information, under App type, make sure you select WEB.
Heroku account Heroku is a service that enables you to host web applications for free. Deploying the starter app to Heroku means you don't need your own server.
Heroku CLI The Heroku Command Line Interface (CLI) 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 repository on GitHub.
  2. In the README, 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
      • Callback URL in the following format: https://{Heroku app name}.herokuapp.com/auth
      • Channel ID (found in the console)
      • Channel secret (found in the console)
  4. Select Deploy app and confirm that your app is successfully deployed.

Step 2: Configure your LINE Login channel

  1. Go to the console and open your channel details.
  2. On the Channel settings tab, under App type, make sure WEB is displayed.
  3. On the App settings tab, enter the Callback URL from Heroku (https://{Heroku app name}.herokuapp.com/auth).

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.

  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 the previous step.

Make sure you have the following installed: - JDK 1.8 or higher - Maven™ 3.0 or higher - Git™

  1. Clone the line-login-starter 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 have the "Developing" status when they're created. Channels with this status can only be accessed by users with the Admin or Tester role (see Managing roles). If you want to allow other people to access your app, you have to change its status to "Published". To do so, go to the console, open your channel settings, and click the Developing 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 it's linked to.

Next steps

{{ $t("form.question.helpful") }}

{{ $t("form.question.detail") }}

{{ $t("form.question.improve") }}

{{ $t("form.info.start") }}{{ $t("form.info.link") }}{{ $t("form.info.end") }}


{{ $t("form.result.success") }}
{{ $t("form.result.error") }}
{{ $t("form.result.errorLink") }}