Requesting Oauth Authorisation code gives 500 error
I am trying to get permission for a user to use the API from a script, and thought it would be nice to get an oauth token using the trick of creating a webserver on localhost temporarily for the browser to redirect and collect the authorisation code. The documentation states
For development, GitLab allows insecure HTTP redirect URIs.
This suggests my approach should work.
I tried using authorization code with and without PKCE as documented at https://docs.gitlab.com/ee/api/oauth2.html but both give me a 500 error (Whoops, something went wrong on our end), which isn't terribly useful. Searching suggests this happens when there is an SSL error, so maybe in this case GitLab is not allowing an insecure redirect URL. I'd be grateful if someone could help me diagnose this, or let me know if this approach is a non-starter, in which case I will just have to instruct the user to use a personal access token, though this will have to be stored securely, so is more difficult to manage.