Generic token getter for all the providers

def token_getter(provider, token=None):
        """ Generic token getter for all the providers """
        session_key = provider + '_token'
        if token is None:
            token = session.get(session_key)
        return token