supabase / auth

A JWT based API for managing users and issuing JWT tokens
https://supabase.com/docs/guides/auth
MIT License
1.29k stars 325 forks source link

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

Open lightofjeju opened 4 months ago

lightofjeju commented 4 months ago

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" )
  3. It says it's an incorrect request.
  4. 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" )
  3. empty phone data in response data.

Screenshots

image

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

dshukertjr commented 4 months ago

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 commented 4 months ago

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

lightofjeju commented 4 months ago

@dshukertjr

scope settings page

kakao error url

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.

doong-jo commented 4 months ago

@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.

lightofjeju commented 4 months ago

@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 commented 4 months ago

@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.. 🥲

dshukertjr commented 4 months ago

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

MiryangJung commented 4 months ago

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);
  }
});
kangmingtay commented 3 months ago

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