Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Best Practices and What’s New with LINE SDK

Best Practices and What’s New with LINE SDK

LINE DevDay 2020

November 26, 2020
Tweet

More Decks by LINE DevDay 2020

Other Decks in Technology

Transcript

  1. What is LINE SDK? Provides a modern way of implementing

    LINE Login and LINE APIs on mobile platforms.
  2. Easy login for users LINE Login Talk to LINE service

    LINE APIs Simplify your work Built-in UI
  3. Versions We are keeping to deliver high quality SDKs to

    help your development, on multiple platforms. 2020 2019.02 LINE SDK for Unity 2017.04 LINE SDK v4 2019.07 LINE SDK for Flutter 2018.11 LINE SDK v5 Open Source 2014.02 LINE SDK v3
  4. › Get authorization in a trustable way › Create your

    users system based on their LINE accounts › Get permissions (access token) to use other LINE APIs LINE Login For more, visit LINE Developers Console: https://developers.line.biz/
  5. Workflow One-Time Sharing One-Time Sharing Create a Message Choose Destination

    Send the Message Get Permissions › ONETIME_SHARE feature license in your Channel Requirement: › onetime.share permission from user in your app
  6. Workflow One-Time Sharing One-Time Sharing Create a Message Choose Destination

    Send the Message Get Permissions LINE SDK provides a beautiful interface to create messages. › Text › Image › Video › Audio › Location › Template › Flexible
  7. Text Message Template Message Flexible Message Message Types Some Examples

    Compatible with Swift (Swift an the Swift lo o a e t a ema of pple n
  8. Workflow One-Time Sharing One-Time Sharing Create a Message Choose Destination

    Send the Message Get Permissions Built-in friends/groups picker
  9. Workflow One-Time Sharing One-Time Sharing Create a Message Choose Destination

    Send the Message Get Permissions Built-in friends/groups picker › Just one line code, easy to use
  10. Workflow One-Time Sharing One-Time Sharing Create a Message Choose Destination

    Send the Message Get Permissions Built-in friends/groups picker › Just one line code, easy to use › A universal user experience
  11. Workflow One-Time Sharing One-Time Sharing Create a Message Choose Destination

    Send the Message Get Permissions Built-in friends/groups picker › Just one line code, easy to use › A universal user experience › Customizable (tint color, text color)
  12. Workflow One-Time Sharing One-Time Sharing Create a Message Choose Destination

    Send the Message Get Permissions Built-in friends/groups picker › Just one line code, easy to use › A universal user experience › Customizable (tint color, text color)
  13. Workflow One-Time Sharing One-Time Sharing Create a Message Choose Destination

    Send the Message Get Permissions Built-in friends/groups picker › Just one line code, easy to use › A universal user experience › Customizable (tint color, text color) It is also possible if you want to create the UI from scratch yourself.
  14. Workflow One-Time Sharing One-Time Sharing Create a Message Choose Destination

    Send the Message Get Permissions Nothing to worry about if using built-in picker
  15. Workflow One-Time Sharing One-Time Sharing Create a Message Choose Destination

    Send the Message Get Permissions Nothing to worry about if using built-in picker If you are building UI yourself… › Issue a one-time sharing token based on user action. › Call message sending API with that token immediately.
  16. One-Time Sharing Summary Sending messages from your app to LINE

    Feature license and permission is required
  17. One-Time Sharing Summary Sending messages from your app to LINE

    Feature license and permission is required Delightful & powerful message APIs
  18. One-Time Sharing Summary Sending messages from your app to LINE

    Feature license and permission is required Delightful & powerful message APIs Built-in & customizable UI
  19. LINE OpenChat A talk room for common interests and topics

    Started from 2019.08 Make a group without the friend relationship
  20. Feature License & Permission OpenChat Support Feature License (Channel) Permission

    (Client) OPENCHAT_TERM_AGREEMENT_STATUS openchat.term.agreement.status OPENCHAT_INFO openchat.info OPENCHAT_CREATE_AND_JOIN openchat.create.join
  21. OpenChat Support Summary Creating and joining an OpenChat room Feature

    license and permission is required Increasing customer stickiness
  22. OpenChat Support Summary Creating and joining an OpenChat room Feature

    license and permission is required Increasing customer stickiness Built-in & customizable UI
  23. Other Changes UI Locales support Localization for Web Login New

    refreshing model Refreshable Refresh Token PKCE Support Better OAuth Compatibility
  24. Better OAuth Compatibility PKCE Support New Before One Time Password

    (OTP) challenge Identify user when exchanging access token when login
  25. Better OAuth Compatibility PKCE Support New Before One Time Password

    (OTP) challenge RFC 7637 Now Proof Key for Code Exchange (PKCE) Identify user when exchanging access token when login
  26. Refresh Token Default refreshing model Valid Days 0 30 60

    90 120 Access Token Refresh Token New authorization required
  27. Refreshable Refresh Token The new opt-in refreshable model Valid Days

    0 30 60 90 120 Access Token Refresh Token New
  28. Refreshable Refresh Token The new opt-in refreshable model Valid Days

    0 30 60 90 120 Access Token Refresh Token New
  29. Refreshable Refresh Token The new opt-in refreshable model Valid Days

    0 30 60 90 120 Access Token Refresh Token New
  30. Refreshable Refresh Token The new opt-in refreshable model Valid Days

    0 30 60 90 120 Access Token Refresh Token New
  31. Refreshable Refresh Token The new opt-in refreshable model Valid Days

    0 30 60 90 120 Access Token Refresh Token New
  32. Refreshable Refresh Token The new opt-in refreshable model Valid Days

    0 30 60 90 120 Access Token Refresh Token New
  33. Choose Refresh Model 0 30 60 90 120 0 30

    60 90 120 Default Model › Default for all channels
  34. Choose Refresh Model 0 30 60 90 120 0 30

    60 90 120 Default Model › Default for all channels › For general use cases
  35. Choose Refresh Model 0 30 60 90 120 0 30

    60 90 120 Default Model › Default for all channels › For general use cases › Existing implementation not affected
  36. Choose Refresh Model 0 30 60 90 120 0 30

    60 90 120 Default Model Refreshable Model › Default for all channels › For general use cases › Existing implementation not affected
  37. Choose Refresh Model 0 30 60 90 120 0 30

    60 90 120 Default Model Refreshable Model › Default for all channels › For general use cases › Existing implementation not affected › Require special feature license
  38. Choose Refresh Model 0 30 60 90 120 0 30

    60 90 120 Default Model Refreshable Model › Default for all channels › For general use cases › Existing implementation not affected › Require special feature license › For frequency users and situations
  39. Choose Refresh Model 0 30 60 90 120 0 30

    60 90 120 Default Model Refreshable Model › Default for all channels › For general use cases › Existing implementation not affected › Require special feature license › For frequency users and situations › LINE SDK upgrade not needed
  40. Do not trust client Your server should not trust unsigned

    information from Client Your Server LINE SDK Your App
  41. Do not trust client Your server should not trust unsigned

    information from Client Your Server LINE SDK Your App Login
  42. Do not trust client Your server should not trust unsigned

    information from Client Your Server LINE SDK Your App Login User ID, name access token
  43. Do not trust client Your server should not trust unsigned

    information from Client Your Server LINE SDK Your App Login User ID, name access token User ID, name
  44. Do not trust client Your server should not trust unsigned

    information from Client Your Server LINE SDK Your App Login User ID, name access token User ID, name
  45. Do not trust client Your server should not trust unsigned

    information from Client Your Server LINE SDK Your App Login User ID, name access token
  46. Do not trust client Your server should not trust unsigned

    information from Client Your Server LINE SDK Your App Login User ID, name access token access token
  47. Do not trust client Your server should not trust unsigned

    information from Client Your Server LINE SDK Your App access token
  48. Do not trust client Your server should not trust unsigned

    information from Client Your Server LINE SDK Your App access token LINE Server
  49. Do not trust client Your server should not trust unsigned

    information from Client Your Server LINE SDK Your App access token LINE Server /profile API
  50. Do not trust client Your server should not trust unsigned

    information from Client Your Server LINE SDK Your App access token LINE Server /profile API User ID, name
  51. Prefer Using ID Token If you only need to identify

    user instead of using other LINE APIs
  52. Prefer Using ID Token If you only need to identify

    user instead of using other LINE APIs Your Server LINE SDK Your App LINE Server Login
  53. Prefer Using ID Token If you only need to identify

    user instead of using other LINE APIs Your Server LINE SDK Your App LINE Server Login req: ID Token
  54. Prefer Using ID Token If you only need to identify

    user instead of using other LINE APIs Your Server LINE SDK Your App LINE Server Login ID Token req: ID Token
  55. Prefer Using ID Token If you only need to identify

    user instead of using other LINE APIs Your Server LINE SDK Your App LINE Server Login ID Token ID Token req: ID Token
  56. What is ID Token Safely signed with ECDSA A JSON

    Web Token containing user information
  57. What is ID Token Safely signed with ECDSA A JSON

    Web Token containing user information You need to verify it against LINE’s public key
  58. Verify the ID Token Your Server LINE SDK Your App

    ID Token LINE Server Login ID Token req: ID Token
  59. Verify the ID Token Your Server LINE SDK Your App

    ID Token LINE Server Login ID Token req: ID Token Verify on your server
  60. Verify the ID Token Your Server LINE SDK Your App

    ID Token LINE Server Login ID Token req: ID Token Verify against LINE /oauth2/v2.1/verify
  61. Verify the Login Creating a secure login process between your

    app and server Documentation Verify ID Token Verify Access Token https://developers.line.biz/en/docs/line-login/secure-login-process/#using-access-tokens-to-register-new-users https://developers.line.biz/en/reference/social-api/#verify-access-token https://developers.line.biz/en/reference/social-api/#verify-id-token Use ID Token in LINE SDK https://developers.line.biz/en/docs/line-login/integrate-line-login/#verify-id-token
  62. Use Universal Link To skip the confirmation before returning, use

    Universal Link to provide a safe navigation 1. Set up “iOS universal link” in LINE Developers Console. 2. Set up the domain and link it to your app. 3. Initialize LINE SDK with universal link.
  63. Use Universal Link To skip the confirmation before returning, use

    Universal Link to provide a safe navigation Universal Links for Developers https://developer.apple.com/ios/universal-links/ 1. Set up “iOS universal link” in LINE Developers Console. 2. Set up the domain and link it to your app. 3. Initialize LINE SDK with universal link.
  64. Use Universal Link To skip the confirmation before returning, use

    Universal Link to provide a safe navigation let url = URL( string: "https://your-awesome-app.com/line-login" ) LoginManager.shared.setup( channelID: channelID, universalLinkURL: url ) 1. Set up “iOS universal link” in LINE Developers Console. 2. Set up the domain and link it to your app. 3. Initialize LINE SDK with universal link.
  65. Use Universal Link To skip the confirmation before returning, use

    Universal Link to provide a safe navigation https://developers.line.biz/en/docs/ios-sdk/swift/universal-links-support/ Using universal links Documentation 1. Set up “iOS universal link” in LINE Developers Console. 2. Set up the domain and link it to your app. 3. Initialize LINE SDK with universal link.
  66. Do Not Refresh Token on Your Server Your Server LINE

    SDK Your App Access Token Refresh Token LINE Server Login Access Token Refresh Token Refresh Token
  67. Do Not Refresh Token on Your Server Your Server LINE

    SDK Your App Access Token Refresh Token LINE Server Login Access Token Refresh Token Refresh Token
  68. Do Not Refresh Token on Your Server Your Server LINE

    SDK Your App Access Token Refresh Token LINE Server Login Access Token
  69. Do Not Refresh Token on Your Server Your Server LINE

    SDK Your App Access Token Refresh Token LINE Server Login Access Token Refresh Token
  70. Do Not Refresh Token on Your Server Your Server LINE

    SDK Your App Access Token Refresh Token LINE Server Login Access Token Refresh Token Access Token
  71. Auto Refreshing Just leave it to LINE SDK All public

    API calls refresh the access token when necessary
  72. Auto Refreshing Just leave it to LINE SDK All public

    API calls refresh the access token when necessary Your app can get a notification when the token refreshed
  73. Auto Refreshing Just leave it to LINE SDK All public

    API calls refresh the access token when necessary Your app can get a notification when the token refreshed An error happens when the refresh token also expires
  74. Auto Refreshing Just leave it to LINE SDK Do not

    try to refresh the token yourself. (Although it is not forbidden.)
  75. Add LINE SDK to your app Become business partner Register

    as a LINE developer https://developers.line.biz/ https://developers.line.biz/en/docs/ https://www.linebiz.com/jp/contact/