This repository contains samples scripts to help get started with the OAuth authentication for Segment APIs.
Shell script examples can be found in shell directory. These scripts are written in bash and can be run in any bash environment.
Creates a private and public key pair using openssl. The private key is used to sign the JWT and the public key is used to verify the JWT. The private key is secured with the client and the public key is uploaded while creating Segment OAuth application.
./create-keypair.sh -s sampleGenerates a JWT access token using the private key for the OAuth app id created in Segment UI and associated with public key id.
./generate-access-token.sh -a 2c3y07DGjEFeTIchtLQaFZ9NDCf -i 2c4EEVxBkmVyJcNsvbapt846Qik -k private-sample.pem -h https://oauth2.segment.io -v onSends a request to the Segment Tracking API using the generated access token.
./send-tapi-request.sh -w <write-key> -j <access-jwt-token> -h https://api.segment.io -o onDecodes JWT token.
./decode-jwt.sh -j <jwt-token>