Feature Request: Authenticated command variable
Background
I created a proxy API as a Node JS service.
This proxy provides multiple GET requests which forwards requests to the Streamelements API (e.g. https://api.streamelements.com/kappa/v2/activities/channel).
The problem here is, that I have to store the JWT token inside the proxy, otherwise the forwarded requests are not authenticated.
So inside a custom chatbot command it would currently look like this:
$(customapi https://my-api-proxy-url.com/path)
Possible solution (feature request)
To perform a GET request using a custom command, I have to use $(customapi) or $(urlfetch). These variables are not authenticated. The only way to authenticate using these variables would be via query parameters (e.g. ?token=JWT_TOKEN).
What do you think about creating a new variable (e.g. $(auth-urlfetch) / $(auth-customapi)) that automatically takes the current account's JWT token and passes it to the URL as a Bearer Authentication Header?
This would have several advantages:
- I do not need to store the JWT token in my proxy. The JWT expires after 6 months, so I would have to update the JWT token in my proxy every 6 months.
- I don't have to pass the JWT token via query parameters. The problem here is, that the “response type” field of a custom command only accepts 500 characters.
- I could possibly make GET requests directly to your Streamelements API (I don't know if there's an actual use case for this, but who knows).
- Maybe more...
I would love to hear your thoughts and look forward to working with you on a solution!
-
Official comment
Hey Jan!
So, we don't really giveaway the JWT token, but we do have an application for you to submit in order to get you oAuth2 credentials, which would bypass the need for the token.
Fill out this form, and our team will get back to you!
https://dev.streamelements.com/docs/api-docs/cd02cda5171ea-o-auth2
Best of luck!
Please sign in to leave a comment.
Comments
1 comment