The current oauth2 generic integration is not really compatible. Therefore I would like to suggest the integration of the openid_connect package. Gitlab uses the package from https://github.com/m0n9oose/omniauth_openid_connect and has provided good compatibility.
Here is a successful integration that works for the billing system WHMCS.
{ 'name' => 'openid_connect',
'label' => 'Billing System',
'args' => {
'name' => 'openid_connect',
'scope' => ['openid','profile', 'email'],
'response_type' => 'code',
'issuer' => 'https://whmcsbilling.domain.com',
'discovery' => true,
'client_auth_method' => 'query',
'client_options' => {
'identifier' => 'BILLING.COM.UELuAJ2rJ32432423424G14Q==',
'secret' => 'x8XBI/343klö324k234+N/kl234lkdrkjl324jlkwer/WdXyodAbZfUdhQNQl+VUGDFzoNLi2GyEAw==',
'redirect_uri' => 'https://support.zammadsystem.com/users/auth/openid_connect/callback'
}
}
}