From 6458bc7fc8d9a42fc08685c0a978dada24572859 Mon Sep 17 00:00:00 2001 From: harture Date: Tue, 23 Apr 2019 09:27:56 +0200 Subject: [PATCH] Remove audience from JWT token to avoid issue between string and string array --- keycloak_client.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keycloak_client.go b/keycloak_client.go index d8b4b38..4ec3de3 100644 --- a/keycloak_client.go +++ b/keycloak_client.go @@ -387,13 +387,13 @@ func str(s string) *string { } -// Token is JWT token and the custom fields present in OIDC Token provided by Keycloak. -// We need to define our own structure as the library define aud as a string instead of a string array. +// Token is JWT token. +// We need to define our own structure as the library define aud as a string but it can also be a string array. +// To fix this issue, we remove aud as we do not use it here. type Token struct { hdr *header Issuer string `json:"iss,omitempty"` Subject string `json:"sub,omitempty"` - Audience []string `json:"aud,omitempty"` ExpirationTime int64 `json:"exp,omitempty"` NotBefore int64 `json:"nbf,omitempty"` IssuedAt int64 `json:"iat,omitempty"`