Verify Apple identity token
To verify the identity token, your app server must
Verify the JWS E256 signature using the server’s public key
Verify the
noncefor the authenticationVerify that the
issfield containshttps://appleid.apple.comVerify that the
audfield is the developer’sclient_idVerify that the time is earlier than the
expvalue of the token
Go :
import(
"github.com/coolishbee/go-verify-apple-id-token"
)
func main() {
client := New()
jwtClaims, err := client.VerifyIdToken("com.clientId.here", "idToken")
if err != nil {
t.Errorf("%s", err)
} else {
fmt.Println(jwtClaims.Email)
}
}Last updated