def validate_token_parameters(params, scope=None):

    if not u'access_token' in params:
        raise KeyError("Missing access token parameter.")

    if not u'token_type' in params:
        raise KeyError("Missing token type parameter.")

    # If the issued access token scope is different from the one requested by
    # the client, the authorization server MUST include the "scope" response
    # parameter to inform the client of the actual scope granted.
    # http://tools.ietf.org/html/draft-ietf-oauth-v2-25#section-3.3
    new_scope = params.get(u'scope', None)
    if scope and new_scope and scope != new_scope:
        raise Warning("Scope has changed to %s." % new_scope)
Ensures token precence, token type, expiration and scope in params.
dataset/ETHPy150Open hzlf/openbroadcast/services/bcmon/requests/packages/oauthlib/oauth2/draft25/parameters.py/validate_token_parameters