How to customize the redirect URL when registering a Github App? #61238
Replies: 12 comments 9 replies
This comment was marked as off-topic.
This comment was marked as off-topic.
-
I am also running into this. Some notes:
I am currently trying to figure out a way how to automate this kind of... my best guess is to first try user authorization and then after having the user you can check whether the user already installed the app and if not redirect to the installation. |
Beta Was this translation helpful? Give feedback.
-
@pieterbreed did you get any workaround for this. I am also in a similar scenario where I want to redirect to 2nd callback url after user authorizes app installation but it always redirects to the first callback url. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Did anyone find any fix for this? I have tried several things but could not find anything till now, essentially for the subsequent redirect when the user already has the app installed :( |
Beta Was this translation helpful? Give feedback.
-
We also have this problem. Anyone know? I realize that there needs to be a way for a user to further fine-tune their settings (e.g. if they selected only one repo, sending to the installation for the 2nd or 3rd time, it may be because they want to add yet another repo). But the user needing to click "Save" in the settings page to initiate the redirect is a very odd user experience and many users don't understand what they need to do in order to proceed. Furthermore, if the user selected "All repositories", there really is no need for the installation. It would be ideal if we had a way, using only an installation token, somehow check the permissions of the client that wants to authenticate in order to decide whether we want to proceed to settings or whether we have all the perms we need and should skip to the next step. We could mimic this ourselves, but only if we allow a user to have only one github user connected on our end. We are incapable of knowing whether the user intends to choose a different account. The flow of the the old OAuth is ideal for this purpose. You ask for permission, and you are either immediately redirected if it is already given, or if you are logged into multiple accounts, you are prompted to choose one. And you are only prompted to grant acceess if the account you chose is not already authorized. |
Beta Was this translation helpful? Give feedback.
-
i've got this option in my configuration |
Beta Was this translation helpful? Give feedback.
-
A naive workaround I found (and used in my side project) was to
|
Beta Was this translation helpful? Give feedback.
-
Like @Yashasv-Prajapati suggested, I'm also using a method that checks if the app was installed. In my app's settings, I have
This approach is far from ideal but it seems to work decently enough for my needs. |
Beta Was this translation helpful? Give feedback.
-
When My workaround, makes use of the fact that the
Super hacky but the best you can do for now |
Beta Was this translation helpful? Give feedback.
-
I've been dealing with similar issues. I found that setting the setup_url works for the first installation, but after that, users are just redirected to the settings page. I’m experimenting with using the state parameter to encode the desired redirect URL and then splitting it on a custom redirect page. Not perfect, but it’s been working so far. |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
I have a registered Github App and in our app we request that users install the app to their account. We do so by presenting our users with a link to
github.com/apps/<our-app-name>/installations/new?state=<some-stuff>
.We have the setting ENABLED for
Request user authorization (OAuth) during installation
, so after making a choice of account, the user is presented with a page titledInstall & Authorize <our-app-name>
and at the bottom, below theInstall & Authorize
button, it has this text:Next: you'll be redirected to https://<our-prod-domain-name>/api/external/github-callback
.My question is this: how can I customize that URL during development? I depend on the parameters that URL receives to complete the authorization flow, but during development, that call goes to production and not to localhost.
Beta Was this translation helpful? Give feedback.
All reactions