title: How to issue tokens from Azure AD in a Node.js App/API?
body: <p>I am building a node app with a express backend. One of the requirements is using Azure AD for authentication. I've installed the <code>passport-azure-ad</code> module and have set it up as the following:</p>
  
  <pre><code>import * as passportAD from "passport-azure-ad";
  // ... &lt;snip&gt; ....
  const tenantName = "&lt;MY_TENANT_NAME&gt;"";
  const clientID = "&lt;MY_CLIENT_ID&gt;";
  
  app.use(passport.initialize());
  app.use(passport.session());
  const bearerStrategy = new passportAD.BearerStrategy(
    {
      identityMetadata: `https://login.microsoftonline.com/${tenantName}.onmicrosoft.com/.well-known/openid-configuration`,
      clientID
    },
    (token: any, done: any) =&gt; {
      console.log(token);
      return done(null, {}, token);
    }
  );
  passport.use(bearerStrategy);
  </code></pre>
  
  <p>Then I have added authorization to a route like this:</p>
  
  <pre><code>const myHandler = () =&gt; (req, res) =&gt; return res.json({});
  app.get('/my/route',
          passport.authenticate("oauth-bearer", { session: false }),
          myHandler()
  );
  </code></pre>
  
  <p>This is returning a 401 status as expected however, I haven't been able to find documentation on how to issue a token to a client from Azure AD.  I'd like to accept a POST to a login endpoint with a username and password in the body and return a Azure AD token. Is this possible?</p>