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
But when I try to submit such request authenticate fails.
How to reproduce
create a simple express js app:
app.ts
import express from "express";
import { withAuthentication, FronteggContext } from "@frontegg/client";
FronteggContext.init({
FRONTEGG_CLIENT_ID: "<vendor client id>", // from here: https://docs.frontegg.com/reference/getting-started-with-frontegg-apis#performing-your-first-api-call
FRONTEGG_API_KEY: "<vendor api key>",
});
const app = express();
const port = 5001;
// This route can now only be accessed by authenticated users
app.use('/', withAuthentication(), (req, res, next) => {
// Authenticated user data will be available on the req.frontegg object
// @ts-ignore
console.log(`JSON.stringify(req.frontegg): ${JSON.stringify(req.frontegg)}`)
res.status(200);
next()
});
app.get("/", (req, res) => {
res.send("Hello, TypeScript Node Express!");
});
app.listen(port, () => {
console.log(`Server is running on port ${port}`);
});
start the server.
Then run the following script to see that different requests fail:
I want to use the
withAuthentication
middle in my app to authenticate user requests submitted with tenant API tokens.There is no documentation about how the client id and secret should be added to the requests.
I looked at the source code and saw this common format:
But when I try to submit such request authenticate fails.
How to reproduce
create a simple express js app:
app.ts
start the server.
Then run the following script to see that different requests fail:
script.ts
The text was updated successfully, but these errors were encountered: