[GH-ISSUE #826] token error #396

Open
opened 2026-02-26 10:32:22 +03:00 by kerem · 3 comments
Owner

Originally created by @BrokenWingsIcarus on GitHub (Aug 26, 2025).
Original GitHub issue: https://github.com/ONLYOFFICE/Docker-DocumentServer/issues/826

Originally assigned to: @lemonowl on GitHub.

Only about using JS SDK to pass the following websocket value prompts authorization failure

Image Image
Originally created by @BrokenWingsIcarus on GitHub (Aug 26, 2025). Original GitHub issue: https://github.com/ONLYOFFICE/Docker-DocumentServer/issues/826 Originally assigned to: @lemonowl on GitHub. Only about using JS SDK to pass the following websocket value prompts authorization failure <img width="885" height="497" alt="Image" src="https://github.com/user-attachments/assets/aa7c5a62-f611-4bea-a25d-60a8b800a25d" /> <img width="976" height="426" alt="Image" src="https://github.com/user-attachments/assets/5d451fe0-eadf-4dfe-9ce2-a5f6fe680358" />
Author
Owner

@BrokenWingsIcarus commented on GitHub (Aug 26, 2025):

new vue client , and it bad.

<template>
   <DocumentEditor 
       id="docEditor" 
       documentServerUrl="http://localhost:9999/"
       :config="config"
       :events_onDocumentReady="onDocumentReady"
       :onLoadComponentError="onLoadComponentError"
   /> 
</template>

<script lang="ts">
import { defineComponent } from 'vue';
import { DocumentEditor } from "@onlyoffice/document-editor-vue";

export default defineComponent({
   name: 'ExampleComponent',
   components: {
       DocumentEditor
   },
   data() {
       return {
           config: {
               token: "123456789",
               document: {
                   fileType: "docx",
                   key: "Khirz6zTPdfd7",
                   title: "Example Document Title.docx",
                   url: "https://example.com/url-to-example-document.docx"
               },
               documentType: "word",
               editorConfig: {
                   callbackUrl: "https://example.com/url-to-callback.ashx"
               }
           }
       }
   },
   methods: {
       onDocumentReady() {
           console.log("Document is loaded");
       },
       onLoadComponentError (errorCode, errorDescription) {
           switch(errorCode) {
               case -1: // Unknown error loading component
                   console.log(errorDescription);
                   break;

               case -2: // Error load DocsAPI from http://documentserver/
                   console.log(errorDescription);
                   break;

               case -3: // DocsAPI is not defined
                   console.log(errorDescription);
                   break;
           }
       }
   },
});
</script>
<!-- gh-comment-id:3223178859 --> @BrokenWingsIcarus commented on GitHub (Aug 26, 2025): new vue client , and it bad. ``` <template> <DocumentEditor id="docEditor" documentServerUrl="http://localhost:9999/" :config="config" :events_onDocumentReady="onDocumentReady" :onLoadComponentError="onLoadComponentError" /> </template> <script lang="ts"> import { defineComponent } from 'vue'; import { DocumentEditor } from "@onlyoffice/document-editor-vue"; export default defineComponent({ name: 'ExampleComponent', components: { DocumentEditor }, data() { return { config: { token: "123456789", document: { fileType: "docx", key: "Khirz6zTPdfd7", title: "Example Document Title.docx", url: "https://example.com/url-to-example-document.docx" }, documentType: "word", editorConfig: { callbackUrl: "https://example.com/url-to-callback.ashx" } } } }, methods: { onDocumentReady() { console.log("Document is loaded"); }, onLoadComponentError (errorCode, errorDescription) { switch(errorCode) { case -1: // Unknown error loading component console.log(errorDescription); break; case -2: // Error load DocsAPI from http://documentserver/ console.log(errorDescription); break; case -3: // DocsAPI is not defined console.log(errorDescription); break; } } }, }); </script> ```
Author
Owner

@BrokenWingsIcarus commented on GitHub (Aug 26, 2025):

Image
<!-- gh-comment-id:3223186037 --> @BrokenWingsIcarus commented on GitHub (Aug 26, 2025): <img width="1103" height="76" alt="Image" src="https://github.com/user-attachments/assets/27bff4b6-2e61-4c99-bc48-039b21c88675" />
Author
Owner

@BrokenWingsIcarus commented on GitHub (Aug 26, 2025):

curl ^"ws://localhost:9999/9.0.4-411fae00275c0bd91bf4056982ba2734/doc/Khirz6zTPdfd7/c/?shardkey=Khirz6zTPdfd7^&EIO=4^&transport=websocket^" ^
-H ^"Upgrade: websocket^" ^
-H ^"Origin: http://localhost:9999^" ^
-H ^"Cache-Control: no-cache^" ^
-H ^"Accept-Language: zh-CN,zh;q=0.9^" ^
-H ^"Pragma: no-cache^" ^
-H ^"Connection: Upgrade^" ^
-H ^"Sec-WebSocket-Key: Wzu7COiQC5ILiUPEyaUQXA==^" ^
-H ^"User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36^" ^
-H ^"Sec-WebSocket-Version: 13^" ^
-H ^"Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits^"

<!-- gh-comment-id:3223192183 --> @BrokenWingsIcarus commented on GitHub (Aug 26, 2025): curl ^"ws://localhost:9999/9.0.4-411fae00275c0bd91bf4056982ba2734/doc/Khirz6zTPdfd7/c/?shardkey=Khirz6zTPdfd7^&EIO=4^&transport=websocket^" ^ -H ^"Upgrade: websocket^" ^ -H ^"Origin: http://localhost:9999^" ^ -H ^"Cache-Control: no-cache^" ^ -H ^"Accept-Language: zh-CN,zh;q=0.9^" ^ -H ^"Pragma: no-cache^" ^ -H ^"Connection: Upgrade^" ^ -H ^"Sec-WebSocket-Key: Wzu7COiQC5ILiUPEyaUQXA==^" ^ -H ^"User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36^" ^ -H ^"Sec-WebSocket-Version: 13^" ^ -H ^"Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits^"
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Docker-DocumentServer-ONLYOFFICE#396
No description provided.