New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-microsoft-login

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-microsoft-login - npm Package Compare versions

Comparing version

to
1.6.0

dist/index.js

5

index.d.ts

@@ -57,2 +57,7 @@ import * as React from "react";

forceRedirectStrategy?: boolean;
/**
* The redirect URI of the application, this should be same as the value in the application registration portal.
*/
redirectUri?: string;
}

@@ -59,0 +64,0 @@

2

package.json

@@ -5,3 +5,3 @@ {

"main": "dist/index.js",
"version": "1.5.0",
"version": "1.6.0",
"author": "alexandrtovmach@gmail.com",

@@ -8,0 +8,0 @@ "bugs": "https://github.com/alexandrtovmach/react-microsoft-login/issues",

@@ -20,15 +20,10 @@ # react-microsoft-login

export default props => {
const authHandler = (err, data) => {
console.log(err, data);
};
const authHandler = (err, data) => {
console.log(err, data)
}
return (
<MicrosoftLogin
clientId={YOUR_CLIENT_ID}
authCallback={authHandler}
/>
)
}
return (
<MicrosoftLogin clientId={YOUR_CLIENT_ID} authCallback={authHandler} />
);
};
```

@@ -40,25 +35,18 @@

| Parameter | Type | Default | Description |
| --------------------- | -------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| clientId | string | required | Application (client) ID |
| authCallback | function | required | Callback function which takes two arguments `(error, authData)` |
| graphScopes | array | `["user.read"]` | Array of Graph API permission names. [More about Graph API permissions](https://developer.microsoft.com/en-us/graph/docs/concepts/permissions_reference). |
| tenantUrl | string | `""` | A URL indicating a directory that MSAL can request tokens from. [More about MSAL tenant auth](https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics). |
| buttonTheme | string | `"light"` | Name of theme for button style. Themes: `"light"` `"light_short"` `"dark"` `"dark_short"`. Styles come from [Official Microsoft brand design](https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-add-branding-in-azure-ad-apps). |
| withUserData | boolean | `false` | Boolean flag to make an additional request to GraphAPI to get user data. |
| forceRedirectStrategy | boolean | `false` | Boolean flag to force redirect login strategy for all browsers. This strategy used by default just for IE browsers to avoid issues. |
| debug | boolean | `false` | Boolean flag to enable detailed logs of authorization process. |
| className | string | `""` | Additional class name string. |
| children | ReactComponent | `null` | Alternative way to provide custom button element as a children prop instead of [Official Microsoft brand design](https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-add-branding-in-azure-ad-apps) |
| Parameter | Type | Default | Description |
| --------------------- | -------------- | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| clientId | string | required | Application (client) ID |
| authCallback | function | required | Callback function which takes two arguments `(error, authData)` |
| graphScopes | array | `["user.read"]` | Array of Graph API permission names. [More about Graph API permissions](https://developer.microsoft.com/en-us/graph/docs/concepts/permissions_reference). |
| tenantUrl | string | `""` | A URL indicating a directory that MSAL can request tokens from. [More about MSAL tenant auth](https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics). |
| redirectUri | string | `window.location.href` | The redirect URI of the application, this should be same as the value in the application registration portal. |
| buttonTheme | string | `"light"` | Name of theme for button style. Themes: `"light"` `"light_short"` `"dark"` `"dark_short"`. Styles come from [Official Microsoft brand design](https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-add-branding-in-azure-ad-apps). |
| withUserData | boolean | `false` | Boolean flag to make an additional request to GraphAPI to get user data. |
| forceRedirectStrategy | boolean | `false` | Boolean flag to force redirect login strategy for all browsers. This strategy used by default just for IE browsers to avoid issues. |
| debug | boolean | `false` | Boolean flag to enable detailed logs of authorization process. |
| className | string | `""` | Additional class name string. |
| children | ReactComponent | `null` | Alternative way to provide custom button element as a children prop instead of [Official Microsoft brand design](https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-add-branding-in-azure-ad-apps) |
## To do
1. ~~Add regex validation for clientId~~
2. ~~Research about possibility to add validation for graph scopes~~
3. ~~Finish implementing support for IE and Edge~~
4. ~~Check possibilities of design customisation~~
5. Handle token expiration [with ADAL.js](https://docs.microsoft.com/en-us/azure/active-directory/develop/single-page-application#token-expiration)
## License
[MIT](https://github.com/nishanths/license/blob/master/LICENSE)