/gin-jwt-authz

Validate the JWT scope to authorize access to an endpoint

Primary LanguageGoMIT LicenseMIT

gin-jwt-authz

Validate a JWTs scope to authorize access to an endpoint. gin-jwt-authz is a Gin middleware/handler inspired by express-jwt-authz

Install

$ go get -u github.com/Watson-Sei/gin-jwt-authz

Usage

Use it with go-jwt-middleware to validate the JWT and make sure you have the proper permissions to call the endpoints.

Sample code is here.

Options

  • failWithError: When set to true, will forward errors to next instead of ending the response directly. Defaults to true.
  • checkAllScopes: When set to true, all the expected scopes will be checked against the user's scopes. Defaults to true.