Refactored authentication to handle sets of required scopes