'Helper method that returns a generator used to iterate over all providers
of the current site.'

@classmethod
def _enabled_providers(cls):

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