The resulting link for the button is http://xxx/moodle/auth/oauth2/login.php?id=3&wantsurl=http%3A%2F%2F1xxx%2Fmoodle%2F%3F&sesskey=8mZDh3OCPF
however when we click on it, the browser's url shows http://xxx/moodle/auth/oauth2/?client_id=4_xxx&response_type=code&redirect_uri=http%3A%2F%2Fxxx%2Fmoodle%2Fadmin%2Foauth2callback.php&state=%2Fauth%2Foauth2%2Flogin.php%3Fwantsurl%3Dhttp%253A%252F%252Fxxx%252Fmoodle%252F%26sesskey%3D8mZDh3OCPF%26id%3D3&scope=openid%20profile%20email
(login.php has been removed from the url).
If i add it manually the response says there is a missing id parameter, I don't know what it is (the client_id is present).