class Google::Auth::ServiceAccountJwtHeaderCredentials

def new_jwt_token jwt_aud_uri = nil, options = {}

Creates a jwt uri token.
def new_jwt_token jwt_aud_uri = nil, options = {}
  now = Time.new
  skew = options[:skew] || 60
  assertion = {
    "iss" => @issuer,
    "sub" => @issuer,
    "exp" => (now + EXPIRY).to_i,
    "iat" => (now - skew).to_i
  }
  jwt_aud_uri = nil if @scope
  assertion["scope"] = Array(@scope).join " " if @scope
  assertion["aud"] = jwt_aud_uri if jwt_aud_uri
  logger&.debug do
    Google::Logging::Message.from message: "JWT assertion: #{assertion}"
  end
  JWT.encode assertion, @signing_key, SIGNING_ALGORITHM
end