JSON encode user metadata before URL encoding it for openid redirect