Check application-level scopes in client_credentials and password flow

Gonna write tests l8r
Avoid using {...} for multi-line blocks.