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.
- 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)
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.
- Click the Deploy to Heroku button to go to the Heroku Dashboard to configure and deploy the app.
- Enter a Heroku app name (optional).
- Enter the following Heroku config variables.
- Click the Deploy button. Heroku then deploys this repository to a new Heroku app on your account.
Set the callback URL in the "App settings" page of the LINE Developers console.
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.
- Go to the URL of your app to open up the LINE Login dialog.
https:// + {Heroku app name} + .herokuapp.com
- Log in to LINE and agree to grant the required permissions to the 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)
To get more information, you can check the logs of your app using [Heroku CLI][heroku-cli].
-
Log in to Heroku from the command line
$ heroku login
-
View the logs. For more information, see View logs.
$ heroku logs --app {Heroku app name} --tail
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 installed
- Maven 3.0 or higher installed
- Git
-
Clone this GitHub repository.
git clone https://github.com/line/line-login-starter.git
-
cd
into your Git directory -
Add a remote for Heroku to your local repository
$ heroku git:remote -a {Heroku app name}
-
Make edits and commit changes (optional)
$ git add . $ git commit -m "First commit"
-
Push changes to Heroku master
$ git push heroku master
For more information on how to integrate LINE Login with your existing web app, see Integrating LINE Login with your web app.