When integrating with GitHub, installation request for our github app utilize a "state" parameter that is passed to GitHub and returned during the callback process. This mechanism helps maintain context across the OAuth flow.
The state parameter contains a JSON object with two key components:
-
Repository Association:
repofield is used to store the specific repo associated with the original installation request from either the cli or UI. This is used to verify that the installation succeeded. -
UI Redirection:
redirectfield is used to store the redirect url sent in the original installation request. This is mainly used by UI based deploy in rill developer to continue deploy process in the browser.
For authentication-only requests (without installation):
- The same two values are stored in the user's session
- These values are retrieved during the callback process
- This approach maintains context across the authentication flow