Unable to pass token to the management api

I followed Node.js and Express Tutorial: Authentication Using Passport

export default new Strategy(
    callbackURL: "http://localhost:8000/login/auth0",
    clientID: process.env.AUTH0_CLIENT_ID,
    clientSecret: process.env.AUTH0_CLIENT_SECRET,
    domain: process.env.AUTH0_DOMAIN,
    scope: ["openid", "email", "profile", "read:users", "read:current_user", "read:user_idp_tokens"],
  /** @type {import("passport-auth0").VerifyFunction} */
  async (accessToken, _refreshToken, _extraParams, profile, done) => {
    const auth0 = new ManagementClient({
      domain: process.env.AUTH0_DOMAIN,
      token: accessToken,

    const user = await auth0.users.get({ id: profile.id });

I am getting

ManagementApiError: Bad HTTP authentication header format

Hi @tbhaxor,

Welcome to the Auth0 Community!

You will need to initialize the ManagementClient class with a client ID, client secret, and a domain.

For example:

import { ManagementClient } from 'auth0';

var management = new ManagementClient({
  domain: '{YOUR_TENANT_AND REGION}.auth0.com',
  clientId: '{YOUR_CLIENT_ID}',
  clientSecret: '{YOUR_CLIENT_SECRET}',

Reference: ManagementClient

Please let me know how this goes for you.