1.4 KiB
1.4 KiB
go-mockid
OAuth2 / JWT / OpenID Connect for mocking auth... which isn't that different from doing it for real, actually.
Enabling Google OAuth2 (Mid-2020)
- Create an account at https://console.developers.google.com/apis/dashboard
- Go back to https://console.developers.google.com/apis/dashboard
- Create a New Project from the dropdown in the upper left that lists the current project name
- Give the project a name such as
Example Web Appand accept its generated ID - Click "Create"
Add your test domain
- Go back to https://console.developers.google.com/apis/dashboard
- Select your new project from the upper-left drop-down
- Select
Domain Verificationfrom the left hand side of the screen - Add your test domain (i.e.
beta.example.com), but a domain that you actually own - Select
Verify Ownership - Follow the specific instructions for adding a txt record to the subdomain you chose
- Add a collaborator / co-owner if you wish
Enable OAuth2
- Go back to https://console.developers.google.com/apis/dashboard
- Select
OAuth consent screen - Select
External - Complete the consent screen form
Create Google Credentials
- Go back to https://console.developers.google.com/apis/dashboard
- Select
Credentialsfrom the left sidebar - Select
OAuth ID - Select
Web Application - Fill out the same test domain and test app name as before
- Save the ID and Secret to a place you won't forget (perhaps a .gitignored .env)