title: oauth2 - grant a service to make authorized http request to another server
body: <p>I have a remote function (aws lambda) which is designed to make an http request to my RESTful server protected by oauth2. HTTP API needs to be authorized for this reason I would ask you: <strong>how can I retrieve a valid access token for use in my lambda?</strong> </p>
  
  <p>My actual solution is to share the JWT Secret to let lambda function to generate a valid access token.
  I'm not pretty sure about the elegance of this solution, for this reason I would ask if this solution is nice or if there are better ways. Thank you.</p>
  
  <p><a href="https://i.stack.imgur.com/RTj9l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RTj9l.png" alt="enter image description here"></a></p>