Skip to content

Instantly share code, notes, and snippets.

@anthonymarchull
Last active June 17, 2022 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anthonymarchull/7fbbb00e0ae0f3c900e4149f6143bf1c to your computer and use it in GitHub Desktop.
Save anthonymarchull/7fbbb00e0ae0f3c900e4149f6143bf1c to your computer and use it in GitHub Desktop.
import { axios } from "@pipedream/platform";
export default {
name: "Generate Lulu Auth Token",
description: "This will generate a Lulu Auth Token for either the Live or Sandbox API",
key: "generate_lulu_auth_token",
version: "0.0.1",
type: "action",
props: {
api_type: {
type: "object[]",
options: [
{ label: "Live API", value: "https://api.lulu.com/auth/realms/glasstree/protocol/openid-connect/token" },
{ label: "Sandbox API", value: "https://api.sandbox.lulu.com/auth/realms/glasstree/protocol/openid-connect/token" },
],
label: "API Type",
},
base64_key_secret: {
type: "object[]",
options: [
{ label: "Live", value: "something here" },
{ label: "Sandbox", value: "something here" },
],
label: "Base 64 Key & Secret",
},
},
async run() {
await axios($, {
url: this.api_type.value,
method: "post",
headers: { Authorization: this.base64_key_secret.value },
data: {
grant_type: "client_credentials",
},
}).then(function (response) {
console.log(response.data);
});
// return
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment