title: How to sign JWT with a RSA SHA-256 hash
body: <p>I'm trying to get an access token to use office365 api through client credentials. I'm using this guide: <a href="https://stackoverflow.com/questions/28351558/office-365-rest-api-daemon-week-authentication">Office 365 Rest API - Daemon week authentication</a></p>
  
  <p>I'm sending my request using postman (see below)
  <a href="https://i.stack.imgur.com/aWlAf.png" rel="nofollow noreferrer">Postman Picture</a></p>
  
  <p>However postman gives me this error when I send the request "AADSTS70002: Error validating credentials. AADSTS50012: Client assertion contains an invalid signature"</p>
  
  <p>So I'm fairly certain I'm not signing the JWT correctly which is used for the client_assertion parameter in my request. Referring to this stack overflow question <a href="https://stackoverflow.com/questions/28832017/could-not-retrieve-app-only-tokens-for-office-365">Could not retrieve app only tokens for office 365</a> I found that I need to sign it using a RSA SHA-256 hash. However I still couldn't get my JWT to work with any of the resources I found online on how to do this, it still would come back with the same error. Is there an online generator I can use to sign my JWT using a RSA SHA-256 hash? Or any code examples that specifically do this way of singing in C#? Thanks in advance.</p>