Add a new provider: kakao by oiojin831 · Pull Request #366 · supabase/auth · GitHub
Skip to content

Add a new provider: kakao - #366

Closed
oiojin831 wants to merge 1 commit into
supabase:masterfrom
oiojin831:provider-kakao
Closed

oiojin831 wants to merge 1 commit into
supabase:masterfrom
oiojin831:provider-kakao

Conversation

@oiojin831

Copy link
Copy Markdown

Adding a new provider

If I go to this url
http://localhost:9999/authorize?provider=kakao

It will redirect to "agreement page?"
Screen Shot 2022-01-31 at 12 38 27

After I agree with everything.
it will redirect to

http://localhost:3000/?error=server_error&error_description=Error+getting+user+email+from+external+provider
It seems that I am not able to get my email, could anyone help me to debug this?

Since I am not familiar with golang, I couldn't find a way to log the debug message.
Could anyone help me with this.

Thanks.

@J0 J0 mentioned this pull request Jan 31, 2022

@kangmingtay kangmingtay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @oiojin831, thanks for your contributions, please add tests as well and take a look at the contributing guide for adding a new oauth provider! Thanks!

Comment thread api/provider/kakao.go

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove print statement

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks I will check the contributing guide again :D

Comment thread api/provider/kakao.go

func (g kakaoProvider) GetUserData(ctx context.Context, tok *oauth2.Token) (*UserProvidedData, error) {
var u kakaoUser
if err := makeRequest(ctx, tok, g.Config, g.APIPath+"/v2/user/me", &u); err != nil {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since the kakao api requires the developer to pass 2 additional parameters: property_keys and secure_resource, you can't use the wrapper function makeRequest, you'll need to construct the http request on your own (much like the notion implementation)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I will refer the notion implementation to fix it. :D

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kangmingtay I am actually not familiar with golang, could you give me a help to write a debug code?
I was trying to print some log but I couldn't figure out how to do it.

Thank you

@kangmingtay kangmingtay Feb 7, 2022 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can either use the fmt or log package to print the http response returned from /v2/user/me inside makeRequest

If you want to print the contents of a struct, you can try this:

var u kakaoUser
fmt.Printf("%+v", u)

It might also be worth taking a look at the tour of go to familiarise yourself with the language :)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you very much :D

@hf

hf commented Aug 24, 2022

Copy link
Copy Markdown
Contributor

@hf hf closed this Aug 24, 2022
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

Successfully merging this pull request may close these issues.

3 participants