azure-functions-auth icon indicating copy to clipboard operation
azure-functions-auth copied to clipboard

error:0909006C:PEM routines:get_name:no start line

Open ghost opened this issue 4 years ago • 4 comments
trafficstars

I'm using azure-functions-auth module with 1.4.2 latest version.

This is my code:


const validateJwt = require('azure-functions-auth')({
  clientId: '<myClientId>',
  clientSecret: '<myClientSecret>',
  domain: 'https://MyDomain.auth0.com',
  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'm using a machine to machine auth0 communication, when I call my azure function with a valid JWT TOKEN (validated with jwt.io) I'm always getting this error:

{
  "message": "error:0909006C:PEM routines:get_name:no start line"
}

I'm not sure but I think it's related to the encryption part for the RSA algorithme.

Thanks for your feedback and ideas to how handle this error.

ghost avatar Jan 22 '21 09:01 ghost

Did you solve this issue?how?

gitu23452 avatar Feb 11 '21 11:02 gitu23452

I used an other solution instead of azure-functions-auth package

ghost avatar Feb 16 '21 10:02 ghost

did you used different package?

gitu23452 avatar Feb 19 '21 06:02 gitu23452

I used the native packages for node and auth0 and set up the configuration with my azure function

ghost avatar Feb 19 '21 18:02 ghost