The
JWT Generate
Snap allows users to
issue limited scope tokens for internal users.
In the example pipeline below:
Download
this Pipeline
Note:
You need to create, as described in Configuring JWT Accounts to use for this sample.
Use the attached jwt-keystore.jks file to create one.
(The keystore was created using keytool for demo purposes. It contains one symmetric
key with alias: jwt password: jwtpasswd)
jwt-keystore.jks
-
The pipeline makes a REST Post to an internal endpoint with internal user credentials.
The REST endpoint responds with JSON data associated with that user.
-
A Mapper Snap is used to map fields that we
want to embed in the token (user, dept, age in this example).
-
JWT Generate
Snap generates an access token that
embeds this information in the token (using dept as "audience", "user" as the subject and
"age" in custom metadata field).
-
A Mapper is used to isolate the access
token from the output document and return that access token.
-
See the
JWT Validate
Snap documentation to see the
output when this token is validated and decoded back.
To successfully reuse pipelines:
- Download and import the pipeline into SnapLogic.
- Configure Snap accounts as applicable.
- Provide pipeline parameters as applicable.