Skip to content

Golang port of OAuth2Client.prototype.verifyIdToken from google-auth-library-nodejs

License

Notifications You must be signed in to change notification settings

Serjlee/google-id-verifier

 
 

Repository files navigation

google-id-verifier

Golang port of OAuth2Client.prototype.verifyIdToken from google-auth-library-nodejs

Verifies Google-issued ID tokens without making http request to the tokeninfo API.

Usage

import (
    "github.com/serjlee/google-id-verifier"
)

v := googleIDVerifier.CertsVerifier{}
aud := "xxxxxx-yyyyyyy.apps.googleusercontent.com"
err := v.VerifyIDToken(TOKEN, []string{
    aud,
})
if err == nil {
    claimSet, err := googleIDVerifier.Decode(TOKEN)
    // claimSet.Iss,claimSet.Email ... (See claimset.go)
}

Features

Deps

  • golang.org/x/oauth2/jws

See also

About

Golang port of OAuth2Client.prototype.verifyIdToken from google-auth-library-nodejs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%