JWT: add token audience

a token released for API audience cannot be used for web pages and
vice-versa
This commit is contained in:
Nicola Murino
2021-02-02 09:14:10 +01:00
parent 78bf808322
commit 4f609cfa30
6 changed files with 299 additions and 184 deletions

View File

@@ -175,7 +175,7 @@ func (s *httpdServer) checkAddrAndSendToken(w http.ResponseWriter, r *http.Reque
Signature: admin.GetSignature(),
}
resp, err := c.createTokenResponse(s.tokenAuth)
resp, err := c.createTokenResponse(s.tokenAuth, tokenAudienceAPI)
if err != nil {
sendAPIResponse(w, r, err, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)