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

Error sp.create_login_request_url with vitejs #277

Open
joseronero opened this issue Nov 22, 2023 · 1 comment
Open

Error sp.create_login_request_url with vitejs #277

joseronero opened this issue Nov 22, 2023 · 1 comment

Comments

@joseronero
Copy link

sp.create_login_request_url with vitejs

Error: Uncaught TypeError: crypto.randomBytes is not a function

file: saml2.js

line 62: id = '_' + crypto.randomBytes(21).toString('hex');

Why? any solution?

Thanks.

@darioackermann
Copy link

darioackermann commented Jun 6, 2024

You are trying to use crypto in a browser if I understand that correctly. That is not possible as the NodeJS crypto module is a native module. There is no way to bundle it in your ViteJS app and run inside a browser.

You probably do not want to expose your SP keys to a (semi-)public frontend anyway.. you will need a backend…

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

No branches or pull requests

2 participants