Skip to content
Golang port of OAuth2Client.prototype.verifyIdToken from google-auth-library-nodejs
Go
Branch: master
Clone or download
Zeno Zeng
Zeno Zeng Update README.md
Latest commit 2a5b89f Mar 11, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci update checkout path Mar 11, 2017
.gitignore
LICENSE Initial commit Mar 10, 2017
README.md Update README.md Mar 11, 2017
certs.go rename package Mar 11, 2017
certs_test.go rename package Mar 11, 2017
claimset.go rename package Mar 11, 2017
error.go rename package Mar 11, 2017
jwt.go rename package Mar 11, 2017
verifier.go VerifyIDToken Mar 11, 2017
verifier_test.go rename package Mar 11, 2017

README.md

google-auth-id-token-verifier

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

Verify idtoken without making http request to tokeninfo API.

Usage

import (
    "github.com/futurenda/google-auth-id-token-verifier"
)

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

Features

Deps

  • golang.org/x/oauth2/jws

See also

You can’t perform that action at this time.