LINE Login starter

by mohsen-bw

GitHub Readme.md

LINE Login Starter Application

Build Status

This is a starter application to help you get started on integrating LINE Login into a web app or website. This sample Java application demonstrates how you can use LINE Login to let users log in to your app with their LINE accounts and to get user information.

The following instructions describe how to deploy the app on Heroku, view logs, and modify the app for yourself.

Requirements

  • A LINE Login channel with the "WEB" app type. To create a channel, go to Creating a Channel on the LINE Developers site.
  • A Heroku account (free to create)

Deploy the app on Heroku

Deploy

With the "Deploy to Heroku" button, you can easily deploy the LINE Login starter application to Heroku from your web browser by following the steps below.

  1. Click the Deploy to Heroku button to go to the Heroku Dashboard to configure and deploy the app.
  2. Enter a Heroku app name (optional).
  3. Enter the following Heroku config variables.
    • Channel ID: Found in the "Channel settings" page in the console
    • Channel secret: Found in the "Channel settings" page in the console
    • Callback URL: https:// + "Heroku app name" + .herokuapp.com/auth
  4. Click the Deploy button. Heroku then deploys this repository to a new Heroku app on your account.

Configure your app in the console

Set the callback URL in the "App settings" page of the LINE Developers console.

Run the app in a browser

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 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)

View logs

To get more information, you can check the logs of your app using [Heroku CLI][heroku-cli].

  1. Log in to Heroku from the command line

    $ heroku login
  2. View the logs. For more information, see View logs.

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

Download and make changes to the starter 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.

  1. Make sure you have the following installed

    • JDK 1.8 or higher installed
    • Maven 3.0 or higher installed
    • Git
  2. Clone this GitHub repository.

    git clone https://github.com/line/line-login-starter.git
  3. cd into your Git directory

  4. Add a remote for Heroku to your local repository

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

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

    $ git push heroku master

Other resources

For more information on how to integrate LINE Login with your existing web app, see Integrating LINE Login with your web app.