// use middleware by `withAzureADBearer()` to validate and extract // bearer token by Azure AD instance app.get('/', [withAzureADBearer()], async (request, response) => { // at this point we have a value token here console.log('authInfo', request.authInfo) })
app.listen() .then(() =>console.log('Server now running on port ' + app.port)) .catch((err) =>console.error(err))
Creates a new middleware, which checks if an Azure AD OAuth Token is valid or not, by using
oauth-bearer
stradegy.Example
Returns
The new middleware.