ueberauth / ueberauth_google

Google OAuth2 Strategy for Überauth.
MIT License
164 stars 85 forks source link

Allow the userinfo endpoint to be configured via options. #75

Closed mpinkston closed 4 years ago

mpinkston commented 4 years ago

Currently, the userinfo endpoint is hard-coded into the library. However, to make this work in some environments (specifically China), it's necessary to use a different endpoint.

Since options are set at plug compile-time, this also allows runtime configuration of this value by setting a :system tuple to reference an environment variable containing the appropriate setting.

I realize this may be a bit edge-case, but I figure it may be important for projects that aim to deploy in environments with this restriction. (And now that EKS is finally available in China, it may be more important than before to allow this to be set as a runtime config so folks can use the same build)

I hope this can be of use.

mpinkston commented 4 years ago

no problem. I'll add some in the morning 👍

mpinkston commented 4 years ago

@Hanspagh Allrighty, I've added tests to cover the basics. Let me know what you think.