Implement logging of the OAuth2/OIDC ID Tokens for troubleshooting

Problem to solve:

When implementing the Oauth2_generic and OIDC OmniAuth providers for authenticating to GitLab, we do not log any diagnostic information that would help troubleshoot issues.

The most important piece of information that we would likely use to debug issues is the contents of the ID Token (which is usually a JWT).

This ID Token is received through the back-channel directly and thus cannot be captured via the browser, which makes troubleshooting issues difficult both for support and our customers.

Proposal:

We should log the response we receive from the Auth server when implementing OAuth2/OIDC. The ID Token is what I believe will be most useful for troubleshooting purposes, and logging all its claims should be safe as it should not contain any authentication details, tokens or secrets.

We already do this with SAML (we log the SAML Response) so we should have the same for these providers.

Edited by Alejandro Guerrero