This commit is contained in:
crusader 2018-03-14 18:45:46 +09:00
parent 27967fc67a
commit 8a8f7453e6

View File

@ -55,9 +55,11 @@ func (sh *GatewayRPCHandlers) Init(serverCTX cwf.ServerContext) error {
func (sh *GatewayRPCHandlers) Handshake(socketCTX cwf.SocketContext, ctx *fasthttp.RequestCtx) (id string, extensionsHeader *fasthttp.ResponseHeader) {
var ok bool
// tokenString := string(ctx.Request.Header.Cookie("AuthToken"))
tokenString := string(ctx.QueryArgs().Peek("AuthToken"))
// tokenString := "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJ3d3cub3ZlcmZsb3cuY2xvdWQiLCJleHAiOjE1MjA4NTUwMDksImlhdCI6MTUyMDc2ODYwOSwiaXNzIjoib3ZlckZsb3ciLCJzdWIiOiJvdmVyZmxvd0Bsb2FmbGUuY29tIn0.YvpylMqHdL72p4Otm3y5L9-2zgvXvLFvt9MKK6-wF39_-EJLL-GgTiPVHx2--jr5ApuRIkJVRURVt7RtnGW65Te1to8u5Be6DnXenI5hRfGqfNLfoH0z_iNNbdjTDHLXa5TRE4Hf4oadYDgb7AotYi9-Mz0iNMyVNqPA4mzPO1ABvUPaHi89CwHYN2ZroaicQwaGxgWUX-KIjYXdxmWHi2shTJGpnHQd5RWeRN3H-AZVXkq05f4NSh6kpGIDu-e7lLHHSB4slWWQ0ML00c0C5fdnBJG4Xeisu195Y69ePZu_5lRpv2T3eH9mbEzUw_TEKZP-WGK_koDUGirYKFBaBJvJlaVOM3hUD3hYQ0DueNHqAwaDpr0dGuvSQwjr6tAqGnXscH6Gfj4x_hNMySVzMR-nWYeG7cDSNq9X5N-A93FKF_n-HCf11doDMsgM9rlpH04eVFCpZqNToLgsJVtEOUezuHSwOmnFTbLelquqUD02S_gGlowtE2CVBOccsfHZK9oTw1lInJYRjpxyevdWx1bvyMyZrf1Dk_PRsTtdboqd-RYp6zP1E4x3dky_VSe7AjUQI0t_SQpxL4ysmzs_hXhdiaQ9PwoHKkZW5Cz9z3oPuUi0iEatMx_9gvFUfVqaVRjNCW79ULGB900TixOxHy1UlNDFN9xip2Mmr7qZwrI"
// tokenString := string(ctx.Request.Header.Cookie("authToken"))
tokenString := string(ctx.QueryArgs().Peek("authToken"))
// log.Printf("authToken: %s \n", tokenString)
// log.Printf("authToken: %s \n", string(ctx.QueryArgs().Peek("authToken")))
// tokenString := "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJ3d3cub3ZlcmZsb3cuY2xvdWQiLCJleHAiOjE1MjA5MzQzMjAsImlhdCI6MTUyMDg0NzkyMCwiaXNzIjoib3ZlckZsb3ciLCJzdWIiOiJvdmVyZmxvd0Bsb2FmbGUuY29tIn0.Umjy3_qvFe4A2wv62r7s2XbqnX_P22HIvAJfx8azM-lejRzYu0wOx9T1UFjRPFzEJO8fEztG1sq3FN5g2097tS6-kbrV5TvB5HclCsK7H384k9CrZEFSgImT-_7yotcPvKKydzvSzLznlbgglr1QwHKH-5JmqyMlxaaYmARmjPHY_tt6NByfeXHEwIL0rh-4TMbx4QOrsBlOHbaRKQqxy8CLwDN2c8-eoEvu1TEIaCxR9rqPrHgsy__1WOY_QY1MdyPzmToXQiwhPyy0hU3jlpf7G9GQOgIEoBD-yrk_WbsFihB2S4uS0TsyopOnEtfSYT5sItnfzCikjNFAaKac39mhW9rPZ-XbxEHK_UYpiCIBtdmiP2ObBCS0FUT2won0V5l4pEw7MTkDehZJptGl45Xrb-ELn-T1lOE6LWuQnZz2sPu2_UHJBcxhPvX6F7cUA3Jm0UGKytq-QOyrUCoiF9YiruDrCXiUkwTQocFwhAGYYeUqQx0KybqLkmn9mkB6zfdyIbY3rk0ep0Kwgp3HTcQR2_6SVkLNAihBpPvZsE5HyVB3hWrOjq-6p0KLj4jfykykj0pA9hNs9qDp5Xb7MR0vRJo__qgvCEe1CiKWwTJY0dXiDDwcIZtqL1u_UdiwZg5Q_O-OCX90IgIETHZNiqAOCKp1IuO9BdplxyCEOBw"
token, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) {
// Don't forget to validate the alg is what you expect:
if _, ok := token.Method.(*jwt.SigningMethodRSA); !ok {