Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Auth tokens with Fetch API


I am in the process of migrating from an on-prem Confluence installation to a Atlassian Cloud instance and one of the things I need to do is rewrite a custom macro that we have using Forge.

I have a lambda running in an AWS VPC that connects to a service inside my corporate network (via VPN) that I will need to now expose to the public internet and I want to make sure that this is secured so only my Confluence Cloud instance can retrieve data from it.

I could use an AWS API Gateway Header security token, but this feels relatively insecure. What I would like to do is instead use a custom lambda to perform authorization for any calls to my lambda endpoint.

Using the fetch API as part of Forge, is it possible to pass the OAuth bearer token that the user is using to authenticate to the Atlassian services along with my request to my external API endpoint?

Originally I was going to just craft a HMAC for my request (containing the payload, as well as the confluence cloud id) but it looks like the crypto library shim in Forge is not complete as the 'forge tunnel' command crashes when I attempt to use the crypto.

Using this approach means that way my custom authorization lambda could validate that the token is from my Atlassian instance and return the content, returning a 403 for all other requests. Alternatively, is there a better way to be able to secure my external API call so only users in my Atlassian cloud account can access it?


1 answer

0 votes

Hello @aidos 

You'll probably get more help for your question by posting it on

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence Cloud

Presenter Mode for Confluence is here 🖥 👩‍💻

👋  Hello Community!  My name is Stephanie Zhang, and I’m a product manager on the Confluence cloud team. Today, I’m excited to announce the rollout of  Presenter Mode : a ...

80,646 views 127 304
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you