You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried to use the @azure/msal-node lib for my Authentication process. It works fine with express and I already testet it there, so there is no Issue with this lib.
But once I integrate this within a directus module I get the crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported error.
And this Issue still exists with the newest Version of directus 9.22.4.
To Reproduce
To reconstruct this Issue you can use the following code. (It might get a bit tricky if you have no Azure Client ID but it shouldnt come to the point, were you need it either with this error
Extensiontype module
NodeVersion: 16+ and I've tried 18+ as-well
index.js
import { Request, Response } from "express";
import * as msal from "@azure/msal-node"
export default defineEndpoint((router, context) => {
const clientConfig = {
auth: {
clientId: "xxxxxx",
authority: "https://login.microsoftonline.com/xxxxxxxx",
clientSecret: "xxxxxxx",
}
};
const pca = new msal.ConfidentialClientApplication(clientConfig);
router.get('/login', async(req: Request, res: Response) => {
const authCodeUrlParameters = {
scopes: [".default openid"],
redirectUri: "http://localhost:8055/auth/callback",
};
// get url to sign user in and consent to scopes needed for application
const url = await pca.getAuthCodeUrl(authCodeUrlParameters);
console.log(url);
res.redirect(302, url);
})
})
Describe the Bug
I've tried to use the @azure/msal-node lib for my Authentication process. It works fine with express and I already testet it there, so there is no Issue with this lib.
But once I integrate this within a directus module I get the crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported error.
And this Issue still exists with the newest Version of directus 9.22.4.
To Reproduce
To reconstruct this Issue you can use the following code. (It might get a bit tricky if you have no Azure Client ID but it shouldnt come to the point, were you need it either with this error
Extensiontype module
NodeVersion: 16+ and I've tried 18+ as-well
index.js
package.json
Errors Shown
No response
What version of Directus are you using?
9.22.4.
What version of Node.js are you using?
18.13.0
What database are you using?
Postgres
What browser are you using?
Chrome
How are you deploying Directus?
Docker
The text was updated successfully, but these errors were encountered: