'Generator returning all enabled providers that use the specified
backend on the current site.
Example:
>>> list(get_enabled_by_backend_name("tpa-saml"))
[<SAMLProviderConfig>, <SAMLProviderConfig>]
Args:
backend_name: The name of a python-social-auth backend used by
one or more providers.
Yields:
Instances of ProviderConfig.'

@classmethod
def get_enabled_by_backend_name(cls, backend_name):

    if (backend_name in _PSA_OAUTH2_BACKENDS):
        oauth2_slugs = OAuth2ProviderConfig.key_values('provider_slug', flat=True)
        for oauth2_slug in oauth2_slugs:
            provider = OAuth2ProviderConfig.current(oauth2_slug)
            if ((provider.backend_name == backend_name) and provider.enabled_for_current_site):
                (yield provider)
    elif ((backend_name in _PSA_SAML_BACKENDS) and SAMLConfiguration.is_enabled(Site.objects.get_current(get_current_request()))):
        idp_names = SAMLProviderConfig.key_values('idp_slug', flat=True)
        for idp_name in idp_names:
            provider = SAMLProviderConfig.current(idp_name)
            if ((provider.backend_name == backend_name) and provider.enabled_for_current_site):
                (yield provider)
    elif (backend_name in _LTI_BACKENDS):
        for consumer_key in LTIProviderConfig.key_values('lti_consumer_key', flat=True):
            provider = LTIProviderConfig.current(consumer_key)
            if ((provider.backend_name == backend_name) and provider.enabled_for_current_site):
                (yield provider)
