func (t *ThinToken) Encode() (string, error) {
	thinTokenBytes, err := json.Marshal(t)
	if err != nil {
		return "", fmt.Errorf("thin token json encode error, %+v", err)
	}
	encryptedThinToken, err := AesEncrypt(thinTokenBytes)
	if err != nil {
		return "", fmt.Errorf("encrypt encode thin token failed, %+v", err)
	}
	base64EncodedThinToken := base64.RawStdEncoding.EncodeToString(encryptedThinToken)
	return base64EncodedThinToken, nil
}
the result is save to use in url query
TODO: cookie encrypt key rotation? Maybe we should use something like https://github.com/gorilla/securecookie.
package auth_proxy
import (
	"encoding/base64"
	"encoding/json"
	"fmt"
)
type ThinToken struct {
	RefreshToken  string `json:"r"`
	IDTokenString string `json:"i"`
}