Skip to content
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

DPAPI or something similar #8207

Open
2 of 3 tasks
jssuttles opened this issue Aug 22, 2024 · 2 comments
Open
2 of 3 tasks

DPAPI or something similar #8207

jssuttles opened this issue Aug 22, 2024 · 2 comments
Labels

Comments

@jssuttles
Copy link

jssuttles commented Aug 22, 2024

Issue Type

Before opening an issue, please search and see if it has already been raised.

  • Bug Report

  • Feature Request

  • Successfully reproduced against the latest version of NW.js?

Please use our mailing list or Gitter chatroom to ask questions. The issue tracker is only for bugs and feature requests, in English only. Please note that issues without a repro or code snippet are less likely to be resolved.

Current/Missing Behavior

I'm looking for something that will be able to encrypt and decrypt data for a machine. I see that electron has something like https://www.electronjs.org/docs/latest/api/safe-storage. I've tried incorporating keytar (which is archived) or @azure/msal-node-extensions (https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/extensions/msal-node-extensions). The latter was promising, but I couldn't get nwjs to run it. I was able to get it running in a node.js environment, but when I tried to get it to run using nwjs, it would stall out. When I tried to create a fork in nwjs into node.js, it also failed to load.

Expected/Proposed Behavior

There is a way to encrypt and decrypt data using something like DPAPI for windows.

Additional Info

  • Operating System: Windows 11 Pro
  • NW.js Version: 0.89.0
  • Repro Link:
  • Code snippet:
  • Crash report:
@ayushmanchhabra
Copy link
Contributor

If MSAL runs in Node, it should run in NW.js. You'll have to rebuild the native modules using NW.js's Node headers.

node-gyp rebuild --target=22.2.0 --nodedir=path/to/nw/node/headers

Using 22.2.0 since nw version is 0.89.0

@ayushmanchhabra
Copy link
Contributor

https://github.com/nodejs/node-gyp?tab=readme-ov-file#build-for-third-party-nodejs-runtimes
node-gyp has supported third party runtimes for a while. NW.js v0.89.0 uses Node v22.2.0. node-gyp v10 should be compatible with it but I haven't personally tried it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants