Week 5

 Week 5 at Strastan

This week was all about chasing down bugs, securing credentials, and finally watching our LinkedIn OAuth2 flow behave like it was supposed to. Between graduation prep buzz and lab sessions, I managed to wrestle the last pieces of the integration into place.

 Thoughts

OAuth2 sounds simple until you’re knee-deep in token exchanges, redirect URLs, and CSRF protection. Getting /linkedin/auth to return a clean 302 felt like a small victory especially after hours of decoding CloudWatch logs and patching handler logic. Once the callback started accepting both GET and POST, parsing the authorization code, and saving tokens to DynamoDB, it finally felt like the system was breathing on its own.

Adding the state parameter was a turning point. Encoding the Cognito ID and nonce, storing it with a TTL, and validating it on callback made the whole flow feel airtight. And pulling user profile data from LinkedIn’s /v2/userinfo endpoint? That was the cherry on top.

Challenges

  • Internal server errors on /linkedin/auth were vague and stubborn CloudWatch became my debugging lifeline.
  • Secrets Manager integration required IAM tweaks and refactoring to ditch hardcoded credentials.
  • Validating the OAuth state and linking everything to Cognito identities took precision and patience.
  • Handling both GET and POST responses in the callback Lambda wasn’t as straightforward as expected.

Realizations

  • OAuth2 is less about code and more about trust choreography every step has to be secure and intentional.
  • CloudWatch logs are underrated. They tell you everything if you’re willing to dig.
  • Storing tokens is one thing; linking them to verified identities is what makes the system truly secure.
  • Once you’ve built a clean OAuth flow, everything else profile access, content publishing feels way more achievable.


Comments

Popular posts from this blog

Week 3

Week 7