Add OAuth authorization code flow to console app#12
Merged
Conversation
Agent-Logs-Url: https://github.com/Shane32/EnphaseAPI/sessions/f6b080c6-fc07-42a7-ba93-34acc92e2e92 Co-authored-by: Shane32 <6377684+Shane32@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add user authorization option to console app
Add OAuth authorization code flow to console app
Mar 30, 2026
Shane32
approved these changes
Mar 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The console app had no way to perform the initial OAuth authorization — users had to obtain tokens out-of-band. This adds a first-class
'o'(authorize) option that drives the full authorization code flow.Changes
'o'option in the startup token prompt alongside existing'a'(access token) and'r'(refresh token) pathsAuthorizeAsyncmethod that:response_type=code,client_id, and the defaultredirect_uri(https://api.enphaseenergy.com/oauth/redirect_uri)Process.Start(..., UseShellExecute = true); degrades gracefully if the browser can't be launched/oauth/tokenwithgrant_type=authorization_codeusing Basic auth (base64client_id:client_secret)access_tokento initialize the API client🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.