def provider_validator(request, **kwargs):
    """
    This validator verifies that the validator in URL (eg. /openid/auth0/login)
    is a configured OpenIDConnect policy.
    """
    provider = request.matchdict['provider']
    used = request.registry.settings.get('multiauth.policy.%s.use' %
        provider, '')
    if not used.endswith('OpenIDConnectPolicy'):
        request.errors.add('path', 'provider', 'Unknow provider %r' % provider)
