Coder Social home page Coder Social logo

line-account-link's Introduction

LINE account link: Sample code for LINE account link

GoDocBuild Statusgoreportcard.com

This is sample code to demostration LINE chatbot account link, refer to document https://developers.line.biz/en/docs/messaging-api/linking-accounts/

You could see each step mark in comment (from step 1 to 12)

  1. The bot server calls the API that issues a link token from - the LINE user ID.
  2. The LINE Platform returns the link token to the bot server.
  3. The bot server calls the Messaging API to send a linking URL to the user.
  4. The LINE Platform sends a linking URL to the user.
  5. The user accesses the linking URL.
  6. The web server displays the login screen.
  7. The user enters his/her credentials.
  8. The web server acquires the user ID from the provider's service and uses that to generate a nonce.
  9. The web server redirects the user to the account-linking endpoint.
  10. The user accesses the account-linking endpoint.
  11. The LINE Platform sends an event (which includes the LINE user ID and nonce) via webhook to the bot server.
  12. The bot server uses the nonce to acquire the user ID of the provider's service.

Installation

  • Create your LINE Developer account and create a developer trial account.
    Deploy

  • Deploy this project to heroku

    • You need to fill following configuration during you create project.
      • LINECORP_PLATFORM_CHANNEL_CHANNELSECRET
      • LINECORP_PLATFORM_CHANNEL_CHANNELTOKEN
      • LINECORP_PLATFORM_CHANNEL_SERVERURL
  • Update the webhook url with https://xxx.herokuapp.com/callback in LINE developer

  • Done

If you don't want to deploy your own LINE account link chatbot, you can click follow to add friend

How to Use it

  • Input any test will show quick reply "account link" and "list user"

  • Input "list user"

  • Click link of "list user" will display all user from provider website.

Test account link

  • Input "link"

  • Input ID, PW. (refer from "list") (e.g. "11", "pw11")

  • Click "Click link to completed account link" to link your account to chatbot.

  • Close browser

  • Chatbot already link to your account, input any text will show your information.

line-account-link's People

Contributors

kkdai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.