Skip to content

Could not authenticate you from Maxkey because 405 not allowed

Hi,

Gitlab: 15.8.1-ce.0

I'm using MaxKey as oauth2 provider for gitlab. But after I entered my username/password in MaxKey, it returned to gitlab and shows an error prompt in page /users/sign_in:

Could not authenticate you from Maxkey because "<html> <head><title>405 not allowed</title></head> <body> <center><h1>405 not allowed</h1></center> <hr><center>nginx/1.23.3</center> </body> </html> ".

Here is the related part of gitlab.rb file:

gitlab_rails['omniauth_enabled'] = true
gitlab_rails['omniauth_allow_single_sign_on'] = ['oauth2_generic']
gitlab_rails['omniauth_block_auto_created_users'] = false
gitlab_rails['omniauth_providers'] = [
  {
    "name" => "MaxKey",
    "app_id" => "my id here",
    "app_secret" => "my secret code here",
    "args" => {
      "client_options" => {
        "site" => "https://login.mydomain.com",
        "authorize_url" => "/sign/authz/oauth/v20/authorize",
        "token_url" => "/maxkey/authz/oauth/v20/token",
        "user_info_url" => "/maxkey/api/oauth/v20/me",
      },
      "user_response_structure" => {
        "root_path" => [],
        "id_path" => ['username'],
        "attributes" => { 'name' => 'username', 'nickname' => 'nickName' }
      },
      'name' => 'maxkey',
      'strategy_class' => "OmniAuth::Strategies::OAuth2Generic"
     }
   }
]

Could you please tell me how to fix this issue? Thanks.

Best regards