{"id":21204759,"url":"https://github.com/fazatholomew/salesforce-gas-jwt","last_synced_at":"2025-03-14T22:46:55.224Z","repository":{"id":99083821,"uuid":"371897342","full_name":"Fazatholomew/Salesforce-GAS-JWT","owner":"Fazatholomew","description":"Google Apps Script implementation of Salesforce Oauth using JSON Web Token.","archived":false,"fork":false,"pushed_at":"2021-05-29T06:27:32.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-21T15:23:32.962Z","etag":null,"topics":["google-apps-script","salesforce","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Fazatholomew.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-29T06:24:28.000Z","updated_at":"2023-01-05T15:17:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"b44d702e-18ea-4338-a9c3-b88cdefed4b3","html_url":"https://github.com/Fazatholomew/Salesforce-GAS-JWT","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fazatholomew%2FSalesforce-GAS-JWT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fazatholomew%2FSalesforce-GAS-JWT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fazatholomew%2FSalesforce-GAS-JWT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fazatholomew%2FSalesforce-GAS-JWT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fazatholomew","download_url":"https://codeload.github.com/Fazatholomew/Salesforce-GAS-JWT/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243658186,"owners_count":20326465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["google-apps-script","salesforce","typescript"],"created_at":"2024-11-20T20:39:56.636Z","updated_at":"2025-03-14T22:46:55.135Z","avatar_url":"https://github.com/Fazatholomew.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eWelcome to Salesforce-GAS-JWT 👋\u003c/h1\u003e\n\u003cp\u003e\n  \u003cimg alt=\"Version\" src=\"https://img.shields.io/badge/version-1.0.0-blue.svg?cacheSeconds=2592000\" /\u003e\n  \u003ca href=\"#\" target=\"_blank\"\u003e\n    \u003cimg alt=\"License: Apache--2.0\" src=\"https://img.shields.io/badge/License-Apache--2.0-yellow.svg\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n[![TypeScript](https://badges.frapsoft.com/typescript/code/typescript.svg?v=101)](https://github.com/ellerbrock/typescript-badges/)\n\n\u003e Google Apps Script implementation of Salesforce Oauth using JSON Web Token.\n\n## Install\n\n* ### (Option 1) Create New Google Apps Script Project\n\n```sh\ngit clone https://github.com/Fazatholomew/Salesforce-GAS-JWT.git\ncd Salesforce-GAS-JWT\nnpm i @google/clasp -g\nclasp login\nclasp create --title \"Salesforce JWT Authentication\"\n```\n\n* ### (Option 2) Integrate with existing project\n\nCopy the content of src/ folder and paste it in your project. Import the function from src/index.ts just like the example in Code.ts file.\n\n## Usage\n\n1. Get Connected App in Salesforce and Generate Public and Private Keys by following [this tutorial](https://mannharleen.github.io/2020-03-03-salesforce-jwt/).\n\n2. Push your code into Google Apps Script Project\n\n```sh\nclasp push\n```\n3. Generate Private Key that GAS Supports\n```sh\nopenssl pkcs8 -topk8 -inform pem -in private.pem -outform pem -nocrypt -out newPrivate.pem\n```\n4. Turn the generated private key into single line string\nOpen the newPrivate.pem with text editor. Remove all new line character. Except the one after BEGIN PRIVATE KEY and before END PRIVATE KEY. For example:\n#### Before:\n```\n-----BEGIN PRIVATE KEY-----\nMIICdgIBADANBgkqhkiG9w0BAQEFAASC\nAmAwggJcAgEAAoGBALQXzM8zKoBAJbDo\nmtQsi36RmQUwRpka7r5Sejwi1BQu3bhB\nDKiQnvdkFt2789iQqeGvGoUgS3ifhrqp\nnB+IBoczB3V4F4eIademGvdruktmpqt5\nixJUROScfLfBhsQfMyM5htgCaCyeGUTQ\nDk7Xedd0KTN1C5bB1YsBDB0JTD5AgMBA\nAECgYAvp7Sch4oPIvpffsssfdyDM+Q==\n-----END PRIVATE KEY-----\n```\n#### After:\n```\n\"-----BEGIN PRIVATE KEY-----\\nMIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBALQXzM8zKoBAJbDomtQsi36RmQUwRpka7r5Sejwi1BQu3bhBDKiQnvdkFt2789iQqeGvGoUgS3ifhrqp\nnB+IBoczB3V4F4eIademGvdruktmpqt5ixJUROScfLfBhsQfMyM5htgCaCyeGUTQDk7Xedd0KTN1C5bB1YsBDB0JTD5AgMBA\\nAECgYAvp7Sch4oPIvpffsssfdyDM+Q==-----END PRIVATE KEY-----\"\n```\n5. Save necessary credentials in Property Service in Google Apps Script\nAs of May 29, 2021, in order to pre populate the Property Service and store our environment variables is by clicking Use Legacy Editor \u003e File \u003e Project Properties \u003e Script Properties. \n\n| Property       | Value\n| :------------- | :----------: \n| aud | login.salesforce.com   \n| iss   | Client ID or Consumer Key from Connected App\n| key | Private Key from previous step \n\n\u003cbr\u003e\n\n## Author\n\n👤 **Jimmy Hikmatullah**\n\n* Website: https://jimmyganteng.com\n* Github: [@FazaTholomew](https://github.com/FazaTholomew)\n* LinkedIn: [@faza-jimmy-hikmatullah-48bb54152](https://linkedin.com/in/faza-jimmy-hikmatullah-48bb54152)\n\n***\n_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffazatholomew%2Fsalesforce-gas-jwt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffazatholomew%2Fsalesforce-gas-jwt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffazatholomew%2Fsalesforce-gas-jwt/lists"}