I use my OAuth2 provider to integrate with gitlab.I am getting 422 error page

Hi,
I use my OAuth2 provider to integrate with gitlab.I am getting 422 error page with message “ Sign-in using oauth2_generic auth failed.Sign-in failed because Email can’t be blank and Notification email can’t be blank."
This is my configuration.

gitlab_rails[‘omniauth_enabled’] = true
gitlab_rails[‘omniauth_allow_single_sign_on’] = [‘oauth2_generic’]
gitlab_rails[‘omniauth_auto_link_ldap_user’] = false
gitlab_rails[‘omniauth_block_auto_created_users’] = false
gitlab_rails[‘omniauth_providers’] = [
{
‘name’ => ‘oauth2_generic’,
‘app_id’ => ‘appid’,
‘app_secret’ => ‘appsecret’,
‘args’ => {
client_options: {
‘site’ => ‘http://10.1.11.213:8080’, # including port if necessary
‘authorize_url’ => ‘/oauth/authorize’,
‘token_url’ => ‘/oauth/accessToken’,
‘user_info_url’ => ‘/oauth/v1/openapi/userInfo’
},
user_response_structure: {
root_path: ,
attributes: {
email: ‘email’,
nickname: ‘username’,
} # if the nickname attribute of a user is called ‘username’
},
redirect_url: ‘http://10.1.11.213/users/auth/oauth2_generic/callback’,
strategy_class: “OmniAuth::Strategies::OAuth2Generic”
}
}
]

{“id":1,“username”:“test”,“password”:“password”,“salt”:“salt”,“email”:"aa@bb.com”}

Regards,
Sam

We have: id_path: [‘sub’] (that sub is specifice for our implementation I think) instead of your root_path key.
also, we have what you have as the redirect_url as ‘redirect_uri’ (with the full url)
Finally we have a name “name: ‘oauth2_generic’,” defined (not sure whether that makes a difference).

Order of changing things: I would start with the redirect_uri change, than thew root_path->id_path. And maybe add the name.