src/Core/WebSocket.php
public static function makeToken($launch) {
        global $CFG;
        if ( ! isset($launch->link->id) ) return false;
        $token = $CFG->wwwroot . '::' . $launch->link->id . '::';
        $token .= isset($launch->context->id) ? $launch->context->id : 'no_context';
        $token .= '::';
        $token .= isset($launch->user->id) ? $launch->context->id : 'no_user';
        return $token;
    }
public static function makeToken($launch) {
        global $CFG;
        if ( ! isset($launch->link->id) ) return false;
        $token = $CFG->wwwroot . '::' . $launch->link->id . '::';
        $token .= isset($launch->context->id) ? $launch->context->id : 'no_context';
        $token .= '::';
        $token .= isset($launch->user->id) ? $launch->context->id : 'no_user';
        return $token;
    }
public static function makeToken ( $ launch ) { global $ CFG ; if ( ! isset ( $ launch -> link -> id ) ) return false ; $ token = $ CFG -> wwwroot . '::' . $ launch -> link -> id . '::' ; $ token .= isset ( $ launch -> context -> id ) ? $ launch -> context -> id : 'no_context' ; $ token .= '::' ; $ token .= isset ( $ launch -> user -> id ) ? $ launch -> context -> id : 'no_user' ; return $ token ; }
Build a plaintext token for a particular link_id

The token includes the host, link_id, context_id, and user_id

@param string $launch The LTI launch object

@return string The plaintext token or false if we cannot make a token
Build a plaintext token for a particular link_id