auth icon indicating copy to clipboard operation
auth copied to clipboard

Only the information requested by the scope is not imported. and not response phone_number data

Open lightofjeju opened this issue 2 years ago • 9 comments

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

Only the information requested by the scope is not imported

  1. Check the personal information items that can be received when logging in on the Kakao developer site.
  2. Try OAuth kakao login
  • await supabase.auth.signInWithOAuth( OAuthProvider.kakao, scopes: "profile_image,name,gender,birthday,birthyear,phone_number" )
  1. It says it's an incorrect request.
  2. I didn't request profile_nickname, but it shows that I set it up and requested it.

not response phone_number data

  1. Check the personal information items that can be received when logging in on the Kakao developer site.
  2. Try OAuth kakao login
  • await supabase.auth.signInWithOAuth( OAuthProvider.kakao, scopes: "profile_image,name,gender,birthday,birthyear,phone_number" )
  1. empty phone data in response data.

Screenshots

image

Version (please complete the following information): flutter 3.13.9 supabse_flutter ^2.3.3

lightofjeju avatar Feb 21 '24 07:02 lightofjeju

Check the personal information items that can be received when logging in on the Kakao developer site.

@lightofjeju Can you share the URL for this page?

dshukertjr avatar Feb 21 '24 07:02 dshukertjr

Also I'm going to transfer this issue to the Auth backend repo as it seems like a backend issue.

dshukertjr avatar Feb 21 '24 07:02 dshukertjr

@dshukertjr

scope settings page

  • https://developers.kakao.com/console/app/1037204/product/login/scope ( This page requires a Kakao login. )

kakao error url

  • https://kauth.kakao.com/oauth/authorize?client_id=ad984dd9054b7bf27410f4425dc31901&flow_type=pkce&redirect_uri=https%3A%2F%2Ftpagdfpibubnmmjfdlnh.supabase.co%2Fauth%2Fv1%2Fcallback&response_type=code&scope=account_email+profile_image+profile_nickname+profile_image+name+gender+birthday+birthyear+phone_number&state=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MDg1MDAzMzgsInNpdGVfdXJsIjoiY29tLmV4YW1wbGUuY2h1cmNoOi8vb2F1dGgiLCJpZCI6IjAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMCIsImZ1bmN0aW9uX2hvb2tzIjpudWxsLCJwcm92aWRlciI6Imtha2FvIiwicmVmZXJyZXIiOiJjb20uZXhhbXBsZS5jaHVyY2g6Ly9vYXV0aCIsImZsb3dfc3RhdGVfaWQiOiJmOWI1OTI5OS1lMGVhLTQzMzUtYjZkYi0yYmI5YWJjMjY3ZGUifQ.abg9e9SqjFXJ1I96DKmbpE0uf0IRUyqy_UaTgL1VlKY

And when I checked the auth log in the suppbase dashboard, I didn't receive not only the phone but also the birthdat birthyaer data.

lightofjeju avatar Feb 21 '24 07:02 lightofjeju

@dshukertjr @lightofjeju

https://github.com/supabase/gotrue/blob/757989c1d3856a1dc450c2e0a5cb1c8e0172a6a6/internal/api/provider/kakao.go#L82-L86

It seems to be requested because the above three scopes are always put in by default.

To modify, we need to modify the logic related to scopes, but other providers have the same logic, which seems to be intended maybe.

doong-jo avatar Mar 02 '24 15:03 doong-jo

@doong-jo

Thank you for your answer.

Then, do you have any intention to make the oauthScopes value customizable?

oh.. sorry.. You're not a superbase developer 😁

lightofjeju avatar Mar 05 '24 04:03 lightofjeju

@dshukertjr

hello! Who should I ask about this issue?

I added the phone_number value to scopes, but I am not receiving the phone_number value.

If this function doesn't work, I can't use the supabase auth and I think I'll have to link it with Kakao directly.. 🥲

lightofjeju avatar Mar 06 '24 04:03 lightofjeju

@lightofjeju Our auth team will have a look at this issue whenever possible. Thanks for your patience.

dshukertjr avatar Mar 06 '24 04:03 dshukertjr

It can be solved by attaching a trigger to the user table to create an edge function that get additional information from KAKAO.

for example

serve(async (req) => {
  const { record }: WebhookPayload = await req.json();

  const appMetaData = record.raw_app_meta_data as RawAppMetaData;
  const userMetaData = record.raw_user_meta_data as RawUserMetaData;

  if (appMetaData.provider === "kakao") {
    getKakaoUser(record.id, userMetaData);
  }
});

MiryangJung avatar Mar 06 '24 05:03 MiryangJung

@lightofjeju that's because the auth service requires these scopes by default

kangmingtay avatar Apr 02 '24 08:04 kangmingtay