refactors scope validation and adds scope testing for all grant types