Universal SDK
English
English
  • README
  • Unity SDK
    • Get Started
      • Android Setup(deprecated)
      • Android Setup
        • Jitpack to Migration
      • iOS Setup
    • Integrations
    • Trouble Shooting
      • Google Login issue
      • UniversalSDK.framework Load failure when running app
      • Android Proguard ClassNotFoundException
  • console guide
    • Google Login
      • Android
      • iOS
    • Apple Login
      • iOS
      • Android
        • Redirect Server
    • Facebook Login
  • Server Side
    • Verify Google ID token
    • Verify Apple identity token
    • Verify Facebook access token
Powered by GitBook
On this page
  1. Server Side

Verify Google ID token

PreviousFacebook LoginNextVerify Apple identity token

Last updated 1 year ago

Go :

import "google.golang.org/api/idtoken"

func verifyGoogleIDToken(token, aud string) bool {
	validTok, err := idtoken.Validate(c.Request.Context(), token, aud)
	if err != nil {
		log.Fatal(err)
		return false
	}
	if validTok.Audience != aud {		
		return false
	}
	return true
}
Using a Google API Client Library