react-microsoft-login
Advanced tools
Comparing version
@@ -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 @@ |
@@ -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) |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
45804
180.04%17
54.55%394
275.24%51
-19.05%2
Infinity%2
100%