X Integration: PKCE

Today I'll try to set up the X integration.

I opened the X Developer portal and set up the User Authentication Settings for my app.

Now I need to add a few endpoints and hook it up to the frontend. I will need more than I anticipated:

  • GET /integrations
    • returns all user's integrations' status
  • GET /integrations/x/auth-url
    • sets up PKCE and returns an auth url that contains all required query parameters
  • POST /integrations/x/connect
    • takes the authentication code and exchanges it for an access token using the X api

It ended up being much more complicated, as I was required to implement PKCE. I learned a lot about XSRF, XSS, and cookies. Didn't manage to finish though. Hopefully I'll get some time tommorrow. I'm pretty excited to finish.