gitlabrecaptcha

Self-Hosted Gitlab Invalid reCaptcha key type


I am self hosting Gitlab, and added force reCaptcha to login/register.

I accidentally entered a v3 key and not a v2 key and now I can't log in because it shows:

ERROR for site owner: Invalid key type. 

Any idea on how to change it manually in the files?
I am running Ubuntu Desktop 18.04.4


Solution

  • Another possibility, which I used:

    If you're able to gain access via a previously generated (and saved) GitLab ReST API - PERSONAL ACCESS TOKEN (created with All Scopes / Full Admin privileges), then you can use that token to update your reCAPTCHA keys via the following CLI command:

    user$ curl --request PUT --header \
           "PRIVATE-TOKEN: <PersonalAccessToken>" \
           "https://gitlab.example.com/api/v4/application/settings?recaptcha_private_key=<SecretKey>&recaptcha_site_key=<SiteKey>"
    

    I hope this helps others.