title: Wordpress rest-api authentication from react app for non-logged in user
body: <p>I'm building a series of react apps which are injected to wordpress websites (survey like apps to gather <strong>guest/non-logged in</strong> users data).</p>
  <p>The final step requires creating new post in wordpress with all the gathered data - I'm trying to use rest-api to accomplish this.</p>
  <p>To use wordpress rest-api I at least need to authenticate with ANY user so I started with mentioned in documentation authentication methods like &quot;application passwords&quot; or JWT token generation (plugin) and trying to auth wordpress admin user created for this purpose only.</p>
  <p>It turned out both methods requires using credentials on frontend react app to POST data to the wordpress rest-api. The problem is:</p>
  <ul>
  <li>I'm trying to hide authentication so its happening without user registration or any other action being taken on their part to save the form</li>
  <li>when using &quot;application password&quot; I need to put credentials on react app to make a POST request -  <em>but its exposing credentials</em></li>
  <li>when using JWT Token approach - I can get token only if I send username and password from react app - but its then <em>again exposing login details</em></li>
  </ul>
  <p><strong>Is there a way I could:</strong></p>
  <ul>
  <li>exchange credentials between wordpress and react app in a form of encrypted data? (eg through cookies)</li>
  <li>or authenticate react app in other way?</li>
  <li>or create wordpress post from react app in a different way?</li>
  </ul>
  <p>thank you</p>