-
-
Save anthonymarchull/7fbbb00e0ae0f3c900e4149f6143bf1c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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