Research
Security News
Malicious PyPI Package ‘pycord-self’ Targets Discord Developers with Token Theft and Backdoor Exploit
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
@microsoft/mgt-msal2-provider
Advanced tools
The Microsoft Graph Toolkit Msal 2.0 Provider
The Microsoft Graph Toolkit (mgt) library is a collection of authentication providers and UI components powered by Microsoft Graph.
The @microsoft/mgt-msal2-provider
package exposes the Msal2Provider
class which uses msal-browser to sign in users and acquire tokens to use with Microsoft Graph.
Install the packages
npm install @microsoft/mgt-element @microsoft/mgt-msal2-provider
Initialize the provider in code
import {Providers, LoginType} from '@microsoft/mgt-element';
import {Msal2Provider, PromptType} from '@microsoft/mgt-msal2-provider';
// initialize the auth provider globally
Providers.globalProvider = new Msal2Provider({
clientId: 'clientId',
isMultiAccountDisabled?: Boolean, //Set this to true to disable multi account functionality
scopes?: string[],
authority?: string,
redirectUri?: string,
loginType?: LoginType, // LoginType.Popup or LoginType.Redirect (redirect is default)
prompt?: PromptType, // PromptType.CONSENT, PromptType.LOGIN or PromptType.SELECT_ACCOUNT
sid?: string, // Session ID
loginHint?: string,
domainHint?: string,
options?: Configuration // msal js Configuration object
});
Alternatively, initialize the provider in html (only client-id
is required):
<script type="module" src="../node_modules/@microsoft/mgt-msal2-provider/dist/es6/index.js" />
<mgt-msal2-provider client-id="<YOUR_CLIENT_ID>"
login-type="redirect/popup"
scopes="user.read,people.read"
redirect-uri="https://my.redirect/uri"
multi-account-disabled
authority="">
</mgt-msal2-provider>
The multi-account-disabled
attribute if present disables multi account functionality.
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.
FAQs
The Microsoft Graph Toolkit Msal 2.0 Provider
The npm package @microsoft/mgt-msal2-provider receives a total of 5,655 weekly downloads. As such, @microsoft/mgt-msal2-provider popularity was classified as popular.
We found that @microsoft/mgt-msal2-provider demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.