Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>evi-azure-authNew to Visual Studio Code? Get it now.
evi-azure-auth

evi-azure-auth

evi-azure-auth

|
1 install
| (0) | Free
This Visual Studio Code extension provides Azure authentication capabilities, including commands to log in to Azure, retrieve access tokens, and perform token-related operations. It simplifies Azure authentication workflows for MCP Servers.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

EVI Azure Authentication Extension

Version VS Code License

A Visual Studio Code extension that provides Azure authentication capabilities for MCP (Model Context Protocol) servers and development workflows. This extension simplifies Azure authentication by providing commands to log in to Azure, retrieve access tokens, and perform token-related operations.

Features

  • Azure Authentication: Authenticate with Azure Credentials
  • Token Management: Copy access tokens to clipboard for easy use
  • MCP Server Integration: Send authentication tokens to MCP servers
  • Configuration Flexibility: Support for both .env files and VS Code settings
  • Multi-scope Support: Configure custom Azure AD scopes

Requirements

  • VS Code 1.105.0 or higher
  • Node.js 22.x or higher
  • Azure Active Directory application registration

Installation

From Source

  1. Clone the repository:

    git clone https://code.siemens.com/evi-in-internal/vscose-extension.git
    cd vscose-extension
    
  2. Install dependencies:

    npm install
    
  3. Build the extension:

    npm run build
    

Configuration

Azure AD Application Setup

  1. Register an application in Azure AD
  2. Configure it as a public client application
  3. Note down the Client ID and Tenant ID

Extension Configuration

You can configure the extension using either a .env file:

Using .env file

Create a .env file in your workspace root:

CLIENT_ID=your-azure-client-id
TENANT_ID=your-azure-tenant-id
SCOPES=User.Read,api://your-api/scope
# Server to which the token need to be sent, usually the <Server-URL>/auth
SERVER_URL=https://<HOST>:<PORT>/auth 

Usage

Available Commands

The extension provides the following commands accessible via the Command Palette (Ctrl+Shift+P):

  1. Login to Azure and send token (extension.loginAndSendToken)

    • Initiates Azure authentication flow
    • Retrieves access token
    • Sends token to configured MCP server
  2. 📋 Copy Access Token to Clipboard (extension.copyToken)

    • Copies the current access token to clipboard
    • Useful for manual token usage
  3. Hello World: Send Greeting (Hello-world.greetings)

    • Demo command for testing purposes

Authentication Flow

  1. Open Command Palette (Ctrl+Shift+P)
  2. search of the commands shown in Acailable Commands which are loginAndSendToken, copyToken and greetings
  3. The choice of commands will execute the Extension commands and will display the result.

Development

Project Structure

├── src/
│   ├── extension.ts                    # Main extension logic
│   └── test/
│       └── extension.test.ts           # Test files
├── standalone-scripts/                 # Authentication experiments (for research purposes)
│   ├── auth.ts                         # TypeScript authentication example
│   ├── auth.js                         # JavaScript authentication example
│   ├── auth-cs.py                      # Python authentication example (client secret)
│   └── auth-wcs.py                     # Python authentication example (without client secret)
├── versions/                           # Authentication experiments (for research purposes)
│   └── Hello-world-ext-samp-0.1.0.vsix # Sample extension package
├── server.py                           # Sample HTTP server for testing
├── package.json                        # Extension manifest (command registration, extension metadata)
├── tsconfig.json                       # TypeScript configuration
├── .env.example                        # Example configuration for `.env`
├── .vscodeignore                       # Files to ignore during extension publishing
├── README.md                           # Project documentation
├── LICENSE.md                          # License information
├── CHANGELOG.md                        # Version history and changes
└── .vscode/                            # VS Code workspace settings
    ├── launch.json                     # Debug configuration for F5 launch
    └── tasks.json                      # Build and task configuration

Available Scripts

  • npm run compile - Compile TypeScript files
  • npm run build - Build the extension
  • npm run watch - Watch mode for development
  • npm run test - Run tests
  • npm run lint - Run ESLint

Running Tests

npm test

Development Workflow

  1. Make changes to the source code
  2. Press F5 to open a new Extension Development Host window
  3. Test your changes in the development environment
  4. Run tests to ensure everything works correctly

Dependencies

Runtime Dependencies

  • @azure/msal-node (^3.8.1) - Microsoft Authentication Library for Node.js
  • dotenv (^17.2.3) - Environment variable loader
  • node-fetch (^3.3.2) - HTTP request library

Development Dependencies

  • typescript (^5.9.3) - TypeScript compiler
  • @types/vscode (^1.105.0) - VS Code API type definitions
  • eslint (^9.36.0) - Code linting
  • @vscode/test-* - VS Code testing utilities

Testing the Server Token Functionality

To test the functionality of sending the server token to the server, follow these steps:

  1. Run the Server Script:

    • Navigate to the directory containing the server.py script.
    • Execute the script using Python:
      pip install msal==1.34.0 python-dotenv==1.2.1 requests==2.32.5
      
      python server.py
      
    • Ensure the server is running and ready to receive tokens.
  2. Execute the Extension Command:

    • Open Visual Studio Code.
    • Press Ctrl+Shift+P to open the Command Palette.
    • Search for and execute the command Login to Azure and send token (extension.loginAndSendToken).
  3. Verify the Server Response:

    • Check the terminal where the server.py script is running.
    • You should see the token and user information received by the server.

Test the Generated Package

  1. Generate Package
    • Generate Package through
    vsce package
    
    which already exists in version evi-azure-auth-0.1.0.vsix
  2. Install the Generated Package
    • Got to Vs code Commands (Ctrl + Shift + p) (cmd + Shift + p)
    • search for install from vsix
    • select your package

📝 Release Notes

0.1.0

  • Initial release
  • Azure authentication
  • Token clipboard functionality
  • MCP server integration
  • Configuration support via .env and VS Code settings

How to Contribute to this project?

Please refer to the CONTRIBUTING.md file for guidelines on how to contribute to this project.

📄 License

This project is licensed under the Siemens Inner Source License v1.5 - see the LICENSE.md file for details.

Support

For support and questions:

  • Create an issue in the repository
  • Contact the development team at Siemens EVI-IN

Additional Resources

  • VS Code Extension API
  • Azure MSAL.js Documentation
  • Extension Guidelines
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft