Socket
Book a DemoInstallSign in
Socket

@microsoft/mgt-mock-provider

Package Overview
Dependencies
Maintainers
2
Versions
394
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/mgt-mock-provider

The Microsoft Graph Toolkit Mock Provider

4.2.3-preview.8036278
Source
npmnpm
Version published
Weekly downloads
1.5K
-39.21%
Maintainers
2
Weekly downloads
 
Created
Source

Microsoft Graph Toolkit Proxy Provider

npm

The Microsoft Graph Toolkit (mgt) library is a collection of authentication providers and UI components powered by Microsoft Graph.

The @microsoft/mgt-proxy-provider package exposes the ProxyProvider class which allows a developer to proxy all calls to Microsoft Graph to their own backend. This allows all mgt-components to function properly when the authentication and calls to Microsoft Graph must be done in the backend.

See docs for full documentation of the ProxyProvider

Usage

  • Install the packages

    npm install @microsoft/mgt-element @microsoft/mgt-proxy-provider
    
  • Initialize the provider in code

    import {Providers} from '@microsoft/mgt-element';
    import {ProxyProvider} from '@microsoft/mgt-proxy-provider/exports';
    
    // initialize the auth provider globally
    Providers.globalProvider = new ProxyProvider("https://myurl.com/api/GraphProxy");
    
  • Alternatively, initialize the provider in html (only client-id is required):

    <script type="module" src="../node_modules/@microsoft/mgt-proxy-provider/dist/es6/index.js" />
    
    <mgt-proxy-provider graph-proxy-url="https://myurl.com/api/GraphProxy"></mgt-proxy-provider>
    

See provider usage documentation to learn about how to use the providers with the mgt components, to sign in/sign out, get access tokens, call Microsoft Graph, and more.

Sea also

Keywords

microsoft graph

FAQs

Package last updated on 01 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.