You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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?