Version: v0.1.0 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2020 License: BSD-3-Clause Imports: 2 Imported by: 0


Gateway with a JWT

This recipe is a gateway with a service protected by a JWT.


  • Install Go
git clone https://github.com/project-flogo/microgateway
cd microgateway/activity/jwt/examples/api


Generate a JWT token using the below information: (You may use http://jwtbuilder.jamiekurtz.com/)

     "issuer": "Mashling",
     "audience": "www.mashling.io",
     "subject": "tempuser@mail.com",
     "id": "XX",
     "signingMethod": "HMAC"
     "key": "qwertyuiopasdfghjklzxcvbnm789101"

Note: The id in the above payload is the pet Id.

Start the gateway:

go run main.go

and test below scenario.

Token is Valid

Now run the following in a new terminal:

curl --request GET http://localhost:9096/pets -H "Authorization: Bearer <Access_Token>"

You should see the following response:

   "error":"JWT token is valid",
Token Invalid

You should see the following response:

      "validationMessage":"signature is invalid"


The Go Gopher

There is no documentation for this package.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL