def _collect_names(handlers, scopes, user, client):
    """ Get the names of the claims supported by the handlers for the requested scope. """

    results = set()

    data = {'user': user, 'client': client}

    def visitor(_scope_name, func):
        claim_names = func(data)
        # If the claim_names is None, it means that the scope is not authorized.
        if claim_names is not None:
            results.update(claim_names)

    _visit_handlers(handlers, visitor, 'scope', scopes)

    return results