Refactor duplicated code in OAuth modules

Description

The various oauth implementation modules have duplicated code bits, refactor them in the base oauth2 module.

Environment

None

Status

Assignee

Andrea Aime

Reporter

Andrea Aime

Triage

None

Fix versions

Affects versions

None

Components

Priority

Medium