Skip to content

How to Pass an Auth Token #1378

Answered by ballcoach12
ballcoach12 asked this question in Q&A
Discussion options

You must be logged in to vote

For anyone else who has a similar requirement, here is how I implemented this. In my case, I am using a worker to run the language server in the browser, which means that I am unable to obtain the cookie that contains the token because browser-side code cannot access a cookie.

My implementation follows these steps:

  1. The user logs in and gets a token that is stored in the browser cookie.
  2. When the browser loads the editor, it sends a request back to the hosting server to send the token in a header in the response, which can then be accessed by the requesting code in the browser.
  3. The browser-side application code gets a language client from the monaco-editor-wrapper and sends a notification …

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
9 replies
@msujew
Comment options

@ballcoach12
Comment options

@msujew
Comment options

@ballcoach12
Comment options

@msujew
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by msujew
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants