All tags

How to mock OAuth 2.0 in Go

Jan 04, 2020
14 min read

We use OAuth 2.0 to access your information from GitHub. That way we don't have to store any sensitive data and you don't need an extra account. In production this works great. During development it makes our lives harder because GitHub needs access to our machines. We solve this problem by mocking all OAuth related networks requests to generate a fake token. This token won't give you access to the GitHub API so we also have to stub those requests.