How handle this macro with authentification for JIRA?

I want to implement a new macro/plug-in for Confluence that allows me to show the value of a specified field of an JIRA-Issue. For example: I paste the JIRA-key or the JIRA-link and the field "created", which I want to have, and finally I it shows me only the value of the field "created".

Does something like this exist?

If not: I have the problem that I need the authentification of the user (username/password) for the REST-API request, someone have an idea about this? Or could I see the source code for the existing JIRA Issue Macro?