Skip to content

require 'openssl' require 'jwt' # https://rubygems.org/gems/jwt #132

@Mohamadrezashiri1

Description

@Mohamadrezashiri1

Private key contents private_pem = File.read("YOUR_PATH_TO_PEM") private_key = OpenSSL::PKey::RSA.new(private_pem) # Generate the JWT payload = { # issued at time, 60 seconds in the past to allow for clock drift iat: Time.now.to_i - 60, # JWT expiration time (10 minute maximum) exp: Time.now.to_i + (10 * 60), # GitHub App's client ID iss: "YOUR_CLIENT_ID" } jwt = JWT.encode(payload, private_key, "RS256") puts jwt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions