Search code examples
oauth-2.0gitlabgitlab-api

How to set up the redirect URI for a locally hosted application


I am trying to integrate gitlab's Oauth2 authentication for a script which is run locally on the machine using flask/waitress on localhost:80. The idea is that anyone who uses that script will have to first sign in using their gitlab credentials so only the script will be run only on the projects available to them. Can't use a group access token therefore using this by registering the application. Here's my question: What redirect URi should I use if the app is only run on localhost:80? Simply that? or something else? this is the error i get when i try that. Please let me know, thanks. ps: I tried https://localhost:80 but it gives an "localhost took too long to respond" error


Solution

  • Unless you're setting up TLS (or SSL) with that script (it's unlikely and that port is default for plain text communication anyways), you would just use http as the protocol. So try:

    http://localhost:80
    

    Take a look at this list of common ports, especially, ports 80 (http) and 443 (https).