OAuth2 / JWT / OpenID Connect for mocking auth... which isn't that different from doing it for real, actually.
https://mock.pocketid.app
5ff37be8c5 | ||
---|---|---|
cmd/mailer | ||
examples | ||
mockid | ||
public | ||
vendor | ||
xkeypairs | ||
.gitignore | ||
.ignore | ||
LICENSE | ||
README.md | ||
default.jwk.json | ||
go-test.sh | ||
go.mod | ||
go.sum | ||
mockid.go |
README.md
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 App
and 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 Verification
from 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
Credentials
from 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)