-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[msal-node-extensions]: Add electron webpack sample #4034
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
samuelkubai
merged 17 commits into
dev
from
samples/electron-webpack-msal-node-extensions
Sep 27, 2021
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
f0fe422
samples: add electron webpack sample
samuelkubai a396452
feat: add sample documentation
samuelkubai 0c2185b
feat: implement new bindings api
samuelkubai 7dc44a2
Change files
samuelkubai 8d06338
fix: update package files
samuelkubai dd5d802
Merge branch 'dev' into samples/electron-webpack-msal-node-extensions
samuelkubai 7446a15
fix: update lock files
samuelkubai e0f37d3
fix: update msal-extensions package definition
samuelkubai 410255b
Change files
samuelkubai 882330e
Merge branch 'dev' into samples/electron-webpack-msal-node-extensions
samuelkubai 8884864
fix: remove unnecessary dependency from msal-core
samuelkubai 262e37a
fix: change the sample license to MIT
samuelkubai 9a3340c
refactor: switching from a commit hash to a tag
samuelkubai 72eb5e1
Merge branch 'dev' into samples/electron-webpack-msal-node-extensions
samuelkubai f8cf121
docs: remove the DPAPI.node symlink section
samuelkubai e992411
Merge branch 'dev' into samples/electron-webpack-msal-node-extensions
samuelkubai 1c1852c
Merge branch 'dev' into samples/electron-webpack-msal-node-extensions
samuelkubai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@azure-msal-angular-9ad45f54-0380-40ba-ab9e-2dd4165ff095.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "none", | ||
| "comment": "fix: add forked bindings library to node-extensions", | ||
| "packageName": "@azure/msal-angular", | ||
| "email": "kamausamuel11@gmail.com", | ||
| "dependentChangeType": "none" | ||
| } |
7 changes: 7 additions & 0 deletions
7
change/@azure-msal-browser-b826cb55-92b9-4d28-a1df-7c21444407cc.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "none", | ||
| "comment": "fix: add forked bindings library to node-extensions", | ||
| "packageName": "@azure/msal-browser", | ||
| "email": "kamausamuel11@gmail.com", | ||
| "dependentChangeType": "none" | ||
| } |
7 changes: 7 additions & 0 deletions
7
change/@azure-msal-common-1ea9f7e5-95e2-4a9a-999d-f0cf0da70413.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "none", | ||
| "comment": "fix: integrate forked bindings package", | ||
| "packageName": "@azure/msal-common", | ||
| "email": "kamausamuel11@gmail.com", | ||
| "dependentChangeType": "none" | ||
| } |
7 changes: 7 additions & 0 deletions
7
change/@azure-msal-node-53c1ee23-e281-4469-8157-de3a7da7f77c.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "none", | ||
| "comment": "fix: add forked bindings library to node-extensions", | ||
| "packageName": "@azure/msal-node", | ||
| "email": "kamausamuel11@gmail.com", | ||
| "dependentChangeType": "none" | ||
| } |
7 changes: 7 additions & 0 deletions
7
change/@azure-msal-node-extensions-33dbfcdb-65d5-4562-8fe8-ed9e4e25f6e9.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "patch", | ||
| "comment": "fix: integrate forked bindings package", | ||
| "packageName": "@azure/msal-node-extensions", | ||
| "email": "kamausamuel11@gmail.com", | ||
| "dependentChangeType": "patch" | ||
| } |
7 changes: 7 additions & 0 deletions
7
change/@azure-msal-react-a190dea9-c53d-495e-bec0-e6b732784d54.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "none", | ||
| "comment": "fix: add forked bindings library to node-extensins", | ||
| "packageName": "@azure/msal-react", | ||
| "email": "kamausamuel11@gmail.com", | ||
| "dependentChangeType": "none" | ||
| } |
7 changes: 7 additions & 0 deletions
7
change/electron-msal-node-extensions-6fa1acbd-8856-43ed-a552-1a92016d5e1f.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "none", | ||
| "comment": "fix: integrate forked bindings package", | ||
| "packageName": "electron-msal-node-extensions", | ||
| "email": "kamausamuel11@gmail.com", | ||
| "dependentChangeType": "none" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "none", | ||
| "comment": "fix: add forked bindings library to node-extensions", | ||
| "packageName": "msal", | ||
| "email": "kamausamuel11@gmail.com", | ||
| "dependentChangeType": "none" | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "root": true, | ||
| "parser": "@typescript-eslint/parser", | ||
| "plugins": [ | ||
| "@typescript-eslint" | ||
| ], | ||
| "extends": [ | ||
| "eslint:recommended", | ||
| "plugin:@typescript-eslint/eslint-recommended", | ||
| "plugin:@typescript-eslint/recommended" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| node_modules | ||
| dist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) 2020 Microsoft | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| ## About | ||
| This is a sample that depicts how to integrate the `msal-node-extensions` library to your [electron](https://www.electronjs.org/) application that has been bundled by [webpack](https://webpack.js.org/). | ||
|
|
||
| ## Getting started | ||
| To get started using this sample, you need to do the following: | ||
|
|
||
| **1. Change the MSAL Electron Configuration** \ | ||
| Navigate to the `main.ts` file in the src folder and replace the `<CLIENT_ID>` with your client ID. Follow this [steps](https://docs.microsoft.com/en-us/graph/toolkit/get-started/build-an-electron-app#add-new-application-registration-in-azure-ad-to-get-a-client-id) to generate the client ID from Azure. | ||
|
derisen marked this conversation as resolved.
|
||
|
|
||
| ```js | ||
| // Initialize the electron authenticator | ||
| const config: MsalElectronConfig = { | ||
| clientId: '<CLIENT_ID>', // <<== Replace this placeholder with your client ID | ||
| mainWindow: mainWindow, //BrowserWindow instance that requires auth | ||
| scopes: [ | ||
| 'user.read', | ||
| 'people.read', | ||
| 'user.readbasic.all', | ||
| 'contacts.read', | ||
| 'presence.read.all', | ||
| 'presence.read', | ||
| 'user.read.all', | ||
| 'calendars.read', | ||
| 'Sites.Read.All', | ||
| 'Sites.ReadWrite.All', | ||
| ], | ||
| cachePlugin: new PersistenceCachePlugin(persistence), | ||
| }; | ||
| ``` | ||
|
|
||
| **2. Run `npm install`** \ | ||
| Run `npm install` or your preferred alternative to it, to install the dependencies necessary to run the sample. | ||
|
|
||
| ```bash | ||
| npm install | ||
| ``` | ||
|
|
||
| **3. Start your application** \ | ||
| To start your application, run the command below: | ||
|
|
||
| ```bash | ||
| npm run start | ||
| ``` | ||
|
|
||
| > NOTE: If you encounter any errors related to having some of the binaries built with a different NODE_VERSION, run `npm run rebuild` to try rebuild the application with the right NODE_VERSION target | ||
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <title>Sample Electron Msal Node Etensions</title> | ||
| </head> | ||
| <body> | ||
| <mgt-login></mgt-login> | ||
| <mgt-agenda group-by-day></mgt-agenda> | ||
| <script type="module" src="./dist/renderer.js"></script> | ||
| </body> | ||
| </html> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we follow up on creating an azure repo for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we did, we realized it would take a lot longer to process and thus decided to go on with this setup for the time being as we research on how best to switch to a repo under AzureAD