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

futurenda/google-auth-id-token-verifier

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages