When calling ACSB controller method from Forge confluence global page module is throwing 401 error

when calling atlassian connect spring boot (ACSB) app controller method rest api from Forge app custom ui (confluence global page module) is throwing 401 error

Getting the below exception in connect on forge ACSB app INFO c.a.c.s.i.a.RequireAuthenticationHandlerInterceptor - Rejected incoming request for controller requiring Forge Remote Context authentication (GET /forge/getData)
When I debug see that the anonymous user authentication is happening. Is this expected.
Can someone throw some light on this ?

Hi @AparnaMokkapati

How do you invoke the REST controller in your connect app?

There are the invokeRemote, or you can use Invoke Remote API to invoke a remote from the backend (if you use a resolver with your UI)

Both APIs will add the Forge Invocation Token (FIT) to the request, and even app or user access token if you configured this.

The backend can then use that, in ACSB it will likely need the @ForgeRemote annotation to be precent on the Controller method.

Cheers,
Mark