Trying LINE Login on a web application

The LINE Login starter application is written in Java and lets you quickly see how LINE Login works on a sample web application. This guide explains how to integrate LINE Login on a web server using Heroku. If you'd like to integrate LINE Login with your existing app, go to Integrate LINE Login.

Before you begin

Make sure you have the following:

Get the application

Clone the line-login-starter GitHub repository.

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

Deploy the app

  1. Select the Deploy to Heroku button in the README file
  2. Fill in the required information on the "Create a New App" page in Heroku
    • App Name (optional)
    • Runtime selection
    • Config variables
    • Channel ID (found in the console)
    • Channel secret (found in the console)
    • Callback URL in the following format: https:// + {Heroku app name} + .herokuapp.com/auth
  3. Select Deploy and confirm that your app is successfully deployed

Configure your app

Set the callback URL in the "App settings" page of the console

Try it out

When you successfully log in with your LINE credentials, the app displays your LINE user profile image, display name, and status message. Note that you will be logged in automatically if you are logged in to the LINE app on your iOS or Android device.

  1. Go to the URL of your app to open up the LINE Login dialog. https:// + {Heroku app name} + .herokuapp.com
  2. Log in to LINE and agree to grant the required permissions to the app

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
  • Log out the user (revoke the access token)

Check logs

To get more information, you can check the logs of your app using Heroku CLI.

  1. Log in to Heroku from the command line

    $ heroku login
    
  2. Clone the source code of the app from Heroku using Git

    $ heroku git:clone -a demo-login-starter-app
    
  3. Check the logs

    $ heroku logs --tail
    

Next steps

You have now seen how you can use LINE Login in a web application. To learn more about how to integrate LINE Login with your existing web app, go to Integrating LINE Login with your web app.