https://github.com/movsb/google-idtoken-verifier
Used to verify JWT Token issued from Google Sign-In.
https://github.com/movsb/google-idtoken-verifier
google-sign-in jwt jwt-verifier
Last synced: 4 months ago
JSON representation
Used to verify JWT Token issued from Google Sign-In.
- Host: GitHub
- URL: https://github.com/movsb/google-idtoken-verifier
- Owner: movsb
- Created: 2019-03-29T08:01:59.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-19T12:58:35.000Z (almost 6 years ago)
- Last Synced: 2025-04-02T07:22:28.582Z (7 months ago)
- Topics: google-sign-in, jwt, jwt-verifier
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Google Sign-In Token Verifier
Used to verify JWT Token issued from [Google Sign-In](https://developers.google.com/identity/sign-in/web/).
## How to use
```go
package mainimport (
"fmt"googleidtokenverifier "github.com/movsb/google-idtoken-verifier"
)func main() {
token := "eyJhbGciOiJSUzI1NiIsImtpZCI6ImE0MzEzZTdmZDFl..."
clientID := "YOUR_CLIENT_ID.apps.googleusercontent.com"
claims, err := googleidtokenverifier.Verify(token, clientID)
if err != nil {
panic(err)
}
fmt.Printf("Iss:\t%s\nSub:\t%s\nEmail:\t%s\nName:\t%s\nDomain:\t%s\n",
claims.Iss, claims.Sub, claims.Email, claims.Name, claims.Domain)
}
```## Features
[All steps](https://developers.google.com/identity/sign-in/web/backend-auth#verify-the-integrity-of-the-id-token) described in Google Sign-In are satisfied.
## G Suite
If you are using G Suite, be sure that the `Domain` field matches your host suffix.