def get_providers(self):
        """
        Get OAuth providers
        Returns a dictionary of oauth applications ready to be registered with
        flask oauth extension at application bootstrap.
        """
        if self.providers:
            return self.providers

        providers = dict()
        for provider in self.config:
            configurator = provider.lower() + '_config'
            if not hasattr(self, configurator):
                err = 'Provider [{}] not recognized'.format(provider)
                raise ValueError(err)

            provider_config = self.config[provider]
            configurator = getattr(self, configurator)
            providers[provider] = configurator(
                id=provider_config.get('id'),
                secret=provider_config.get('secret'),
                scope=provider_config.get('scope'),
                offline=provider_config.get('offline')
            )

        self.providers = providers
        return self.providers
def get_providers ( self ) : if self . providers : return self . providers providers = dict ( ) for provider in self . config : configurator = provider . lower ( ) + '_config' if not hasattr ( self , configurator ) : err = 'Provider [{}] not recognized' . format ( provider ) raise ValueError ( err ) provider_config = self . config [ provider ] configurator = getattr ( self , configurator ) providers [ provider ] = configurator ( id = provider_config . get ( 'id' ) , secret = provider_config . get ( 'secret' ) , scope = provider_config . get ( 'scope' ) , offline = provider_config . get ( 'offline' ) ) self . providers = providers return self . providers
Get OAuth providers
        Returns a dictionary of oauth applications ready to be registered with
        flask oauth extension at application bootstrap.