Group with JWT protection


#1

I’m pretty new in Go and Echo :smiley:
I need to create several services which have to be protected by JWT token. My 1st approach is:

jwtProtected := e.Group("/jwt")
jwtProtected.Use(middleware.JWT([]byte("secret)))

For me it means that this group is protected by tokens signed by “secret” secret phrase.

But I want to differentiate secret phrase according to different user groups. So the question is: will it work correctly?

jwtProtected := e.Group("/jwt")
for _, val := range s.conf.Application.JWT.AuthIDs { // AuthIDs is map[string]string
jwtProtected.Use(middleware.JWT([]byte(val)))
}

Best regards