How to use the mediacloud.MediaCloud function in mediacloud

To help you get started, we’ve selected a few mediacloud examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mitmedialab / MediaCloud-Web-Tools / server / auth.py View on Github external
def authenticate_by_key(username, key):
    logger.debug("user %s want to log in with key", username)
    user_mc = mediacloud.MediaCloud(key)
    if user_mc.verifyAuthToken():
        user = create_and_cache_user(username, key)
        user.set_profile(_get_user_profile(key))
        logger.debug("  succeeded - got a key (user.is_anonymous=%s)", user.is_anonymous)
        return user
    logger.debug("failed")
    return flask_login.AnonymousUserMixin()
github mitmedialab / MediaCloud-Dashboard / app / core / authentication.py View on Github external
def authenticate_by_key(username, key):
    user_mc = mcapi.MediaCloud(key)
    if user_mc.verifyAuthToken():
        profile = user_mc.userProfile()
        user = User(username, key, profile=profile)
        User.cached[user.id] = user
        return user
    return AnonymousUserMixin()