-
Notifications
You must be signed in to change notification settings - Fork 384
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
Add a new provider: kakao #366
Conversation
There was a problem hiding this comment.
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!
if err := makeRequest(ctx, tok, g.Config, g.APIPath+"/v2/user/me", &u); err != nil { | ||
return nil, err | ||
} | ||
fmt.Printf("%+v\n", u) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove print statement
There was a problem hiding this comment.
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
|
||
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 { |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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
Hey this PR has been outdated for a long while now. I'll close it, but if you still wish to contribute please re-open it or submit a new one! |
Adding a new provider
If I go to this url
http://localhost:9999/authorize?provider=kakao
It will redirect to "agreement page?"
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.