I was trying to upgrade to 5.1.0 to see how this works but I encounter an issue where not all the atlassian-connect dependencies are available for this version. For example the following dependencies are only available for 5.0.0:
atlassian-connect-spring-boot-api:jar:5.1.0 is missing,
atlassian-connect-spring-boot-core:jar:5.1.0 is missing
I have two questions:
Do you have an idea when all connect dependencies will be available for version 5.1.0?
Is my assumption correct that I should be able to use the ForgeContextRetriever for my Connect-on-Forge app when I upgrade to version 5.1.0? My hope is that it enables my Connect app to make authenticated API calls to Forge Storage, without requiring web triggers or managing separate OAuth flows.
Currently there is no long-term token that is shared between connect and forge. I wish this was the case so you can just access Forge Storage and other GraphQl APIs without needing a webtrigger.
However, if the user initiates the call through a Forge UI or fi a Forge Trigger send an event to your Connect remote, then you will have the ForgeApiContext and possibly system and/or user tokens to access the Forge Storage and other GraphQL APIs without using a webtrigger.
Our apologies, the publish of ACSB version 5.1.0 was incomplete and not all packages were published initially. This has now been resolved and all packages are now available at version 5.1.0.
You can now use ForgeContextRetriever to retrieve the Forge Invocation Token from within your ACSB app. We have also shared a sample app detailing how to use it to make authenticated API calls back to Forge Storage.
As @markrekveld mentions, there is currently no long term token provided by Forge. The Forge Invocation Token is provided as part of a request from Forge to your remote backend, and is only intended to be used within the context of that request.
As such, to be able to use this token, you do need to be responding to a Forge request such as a web trigger, product event trigger, or specific usage of the invokeRemote function from a frontend UI or backend Forge function context.