mawie81 / electron-oauth2

A library to handle OAuth2 authentication for your Electron app.
MIT License
99 stars 56 forks source link

Allow additional parameters for Authorization Code request #34

Closed aguynamedben closed 6 years ago

aguynamedben commented 6 years ago

Google's OAuth2 API allows additional parameters such as prompt=consent to be passed when making the Authorization Code request. This change allows the user to specify additional parameters for the Authorization Code request, similar to how users can already define additional parameters for the subsequent Access Token request.

Google documentation: https://developers.google.com/identity/protocols/OAuth2WebServer#creatingclient Note the parameters state, include_granted_scopes, login_hint, and prompt parameters. With Google's API they wont pass back a refresh_token after the first time a user OAuth unless you pass prompt=consent, so this functionality is pretty critical if you want to use electron-oauth2 with Google and have reliable refresh tokens.

Thanks so much for the time you put into making this library public! It's way better than the hacky code I had before.