Example #1
0
def login_by_session():
    """
    Returns authentication information for the currently logged in user as required by the knowrob.js authentication
    request
    """
    ip = docker_interface.get_container_ip(session['user_container_name'])
    return _generate_rosauth(session['user_container_name'], ip, True)
Example #2
0
def login_by_session():
    """
    Returns authentication information for the currently logged in user as required by the knowrob.js authentication
    request
    """
    ip = docker_interface.get_container_ip(session['user_container_name'])
    return generate_rosauth(session['user_container_name'], ip, True)
Example #3
0
def login_by_session():
    """
    Returns authentication information for the currently logged in user as required by the knowrob.js authentication
    request
    """
    if current_user.is_authenticated:
        ip = docker_interface.get_container_ip(session['user_container_name'])
        return generate_rosauth(session['user_container_name'], ip, True)
    return jsonify({'error': 'not authenticated'})
Example #4
0
def login_by_token(token):
    """
    Returns authentication information for the user assigned to the given API token. This is needed to authenticate
    against the rosbridge by third party clients.
    """
    user = user_by_token(token)
    if user is None:
        return jsonify({'error': 'wrong api token'})
    ip = docker_interface.get_container_ip(user.username)
    return generate_rosauth(user.username, ip)
Example #5
0
def login_by_token(token):
    """
    Returns authentication information for the user assigned to the given API token. This is needed to authenticate
    against the rosbridge by third party clients.
    """
    user = user_by_token(token)
    if user is None:
        return jsonify({'error': 'wrong api token'})
    ip = docker_interface.get_container_ip(user.username)
    return generate_rosauth(user.username, ip)