I want auth a api azure function with keycloak, how i config the middleware to validate jwt in javascript ?
i try this code exp. but this lib is old
const validateJwt = require('azure-functions-auth')({
clientId: 'xxxxxxxxxxxx',
clientSecret: 'xxxxxxxxxxxxxx',
domain: 'xxxxxxxxxxx',
algorithms: ['RS256'],
});
const main = (context, req) => {
context.log('token is valid. (you shouldn\'t log like that in production code)')
return new Promise(resolve => {
resolve('the function will return this exact string as body with a status code of 200')
}).then(asyncResult => {
return asyncResult
})
}
module.exports = validateJwt(main, true)
i want auth a http post to node azure function with jwt keycloak token, help !