Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 1.14 KB

README.md

File metadata and controls

43 lines (31 loc) · 1.14 KB

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