We created a forge application using the template provided by the Atlassian Forge documentation.
A simple Hello World application for Jira.
The frontend index file makes an invoke call to the backend index file that returns a Hello World string. We did not modify anything. Files are all generated by the forge create command.
If the developer executes it, it works fine.
If any other user executes it, even if it is a jira admin, when the frontend makes the invoke call the followint error is thrown -> User does not have access to resource(s).
How is it possible that a tutorial example, with a template, results in something that does not work.
Also there is no clear documentation, or details in the error message, to understand what is it that the user does have no access to.
The application was deployed in production (forge deploy -e production followed by forge install -e production), and the problem persists.
We also tried sharing the application and then installing via shared link, same problem.
Here is the installation link
Looks like other people reported recently the same problem
New findings.
The problem only manifests when, as a site admin, I loged in as another user.
I created a test user account.
When I log in as that user all works fine.
When I log in as an admin(developer) and I use the Log in as user feature, and I impersonate the same user the user does not have access to resources error manifests.
This is making this log in as feature useless.
Because when developing an app, the developer needs to test the app as any other user.
Also if a user reports any problems, the log in as user method should allow the developer to reproduce the problem reported by a user.
Seems like the log in as feature is buggy.
As I answered my own question I will accept my answer :-D
Hi @Petru Simion _Simitech Ltd__ ,
The Forge application does not work when admin is logged in using the Log in as user is an expected behaviour and there is an suggestion request in place for the same https://jira.atlassian.com/browse/ECO-244.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Stating that this is "expected behaviour" not correct.
Expected behavior is that when the impersonator impersonates a user, the impersonator will act 100% like the user in all aspects. Any deviation is not allowing the impersonator to have the same experience as the impersonated.
As a result the impersonator can not reproduce a problem that the impersonated has.
The link you provided is about another bug in the impersonation. For your info this is what the link talks about.
"
The problem I raised is that the invoke method from frontend to backend is not even executing at all.
Regards,
Petru
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Petru Simion _Simitech Ltd__
The Log in as user feature is used for the core Jira/Confluence products. The Forge framework is not designed to work with the impersonated user, as the Forge application runs outside the core product and does not get the impersonated user context from the core product. The application may be calling some of the functionality asUser.
The suggestion request has a specific scenario described, but it includes your scenario as well.
Thanks,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Petru Simion _Simitech Ltd__
You're right to be frustrated, as the situation is weird.
I am not sure, but have you checked the permissions in the app's manifest.yml file? There should be scopes/functions that allow your app's users to perform specific functions.
permissions:
scopes:
-rea:jira...
function:
- read
- write
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When creating the Hello World app using forge create, the resulting manifest file does not contain any scopes. If these scopes would be required the generated manifest should contain the correct scopes for the app to work.
Tried with a few scopes like read:jira-work and read:issue-details:jira but same result.
Bottom line is how can Atlassian provide a template application generated by forge create that does not work and there is no clear reason why and how to fix it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If your app is deployed in the Development environment (indicated by the "Dev" badge in its name), only users listed as Contributors in the Developer Console will have access to it.
To allow broader access, you’ll need to deploy and install the app in the Production environment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We deployed to production, same problem.
We also tried to share the app and deploy vial shared link, same problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Petru Simion _Simitech Ltd__ Apologies for overlooking that detail in your post. Could you let me know which template app you're using? I can try deploying and installing it on my end as well. Also, does it work only when the developer is tunneling, or does it run even without an active tunnel?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No needs to appoligise :-) I added the details after your reponse.
I just used the forge create, followed by selecting Jira and issue panel.
The issue panel displays first Loading, which comes from the frontend file.
The invoke function calls the backend, which returns a "Hello world " string that replaces the Loading.
This only when the user is the developer.
When I impersonate another user, the Loading message stays forever, and the Developer Tools shows -> User does not have access to resource(s).
you can try deploing using the link I provided
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I did not even use tunneling.
Just deployed and installed.
Works for the developer.
Not for any other user.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The problem is that we have developed an app, based of the template.
All works fine, and the final tests revealed the problem.
In order to eliminate any issue we could have created, we tested with a simple Hello World app. Same problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your app appears to be working fine on my end as well. Have you tried using a different browser to see if that makes any difference?
Also, you might want to switch your network or enable a VPN and try accessing the app again. In my experience, some local ISPs fail to resolve the DNS for Forge app resources. Switching to a DNS provider like Cloudflare or Google DNS has usually resolved the issue for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The problem manifests on two different sites (Work and Personal).
They have total different DNS so this could not be the issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.