Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LIFF should request "Profile" instead of "Open ID" #293

Open
MrOrz opened this issue Sep 23, 2021 · 0 comments
Open

LIFF should request "Profile" instead of "Open ID" #293

MrOrz opened this issue Sep 23, 2021 · 0 comments
Assignees

Comments

@MrOrz
Copy link
Member

MrOrz commented Sep 23, 2021

As-is

Currently Cofacts LIFF requests for openid and chat_message.write scope.
image

This triggers the following consent window when the user first opens Cofacts LIFF:

image

Currently the "用戶識別資訊 (必要資訊)" has caused confusion and intimidated users from proceeding.

To-be

We should use profile instead. If we do so, the consent window will become something similar to:

image

The wording of "Profile" scope (個人檔案) is more welcoming to the users.

To achieve this, we should replace current ID token mechanism with access token + get profile API from chatbot server.

Furthermore, we can access liff.getFriendship() after we have access to profile scope, allowing us to display links to add Cofacts chatbot to those who did not.

Implementation detail

  1. We can replace the current mechanism of passing ID tokens to passing access token instead.
  2. On server side, we replace ID token verification mechanism with calling /v2/profile for the userId.
  3. We don't need to call /oauth2/v2.1/verify, /v2/profile should be enough just for retrieving trustworthy userId from LINE.

Other notes

@bil4444 bil4444 self-assigned this Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants