Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
249 views
in Technique[技术] by (71.8m points)

VS code Extension : How to add an authentication to plugin

I want to develop an extension for VS code. It gonna save and store the highlighted commands to the extension state store. This part is ready :)

What I want to do now is try to understand whether I can store these commands on top of VS code state in my existing backend So, I need to somehow build some authentication logic

Is there a way to build the authentication process into an extension?

question from:https://stackoverflow.com/questions/65882770/vs-code-extension-how-to-add-an-authentication-to-plugin

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Here is my scenario used in the extension Docs-validation:
We provide a sign-in button inside the VS CODE, when the user clicks that button, we will redirect the user to a browser to do the auth, after that, an auth token will be sent back to the extension, which will be used to call our backend API. The main logic can be found in this file

Actually, this is inspired by the built-in sign-in experience of the VS Code and some extension with a sign-in experience like azure-cli, you can see from here: enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...