How to define GitLab as custom oauth2 provider in Social Login app

I am attempting to use GitLab as my oauth2 provider in the Social Login app. It fails on the step redirect step after I am successfully directed to GitLab where I log in:

The redirect URI included is not valid.

It displays this error in what appears to be the GitLab user settings page. The URL in the address bar looks like

In the Social Login admin settings, I have the following for the Custom Oauth2 definition:

[my client id]
[my client secret]

In my GitLab application definition (User Settings > Applications) I have the Callback URL as with scopes read_user and read_api (these were the scopes required for me to use GitLab in a JupyterHub deployment that is working properly).

Has anyone configured this successfully for use with GitLab and can help me determine why it is failing?

I immediately made some progress by finding the correct redirect URI and updating my GitLab application accordingly: 

I encountered the GitLab dialog asking if I authorize this application and I hit accept only to encounter another error that displays on my Nextcloud site page at url

Unable to exchange code for API access token. HTTP error 401. Raw Provider API response: {“error”:“invalid_client”,“error_description”:“Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method.”}.

Eventually I figured it out and got it working. My contributed documentation was merged and can be found here if others need help doing the same thing.