CredentialRequiredException thrown for webitem in Project Administration page for users other than global system administrator?

When i access the Project Administration page using System administrator, I am getting the response, but if the Project Administrator access the Webitem in Administration page, it throws credentialRequiredException.

I am trying to fetch the confluence pages using rest api’s. Can someone provide reason for this and possibly a solution to recover from this?

public String getResponseBody(String projectKey, String apiURL) {
** String responseBody = null;**
** try {**
** ApplicationLinkRequestFactory requestFactory = getApplicationLink(projectKey);**
** if (requestFactory != null) {**
** ApplicationLinkRequest request = requestFactory.createRequest(MethodType.GET, apiURL);**
** responseBody = request.execute();**
** }**
** return responseBody;**
** } catch (ResponseException e) {**
** e.printStackTrace();**
** } catch (CredentialsRequiredException e1) {**
** e1.printStackTrace();**
** }**
** return responseBody;**
** }**

How is the app link configured in the system? Does the current user have access to the pages?

I would check in Confluence to see what the user is coming in as in the rest call…

I have used the Application Link page and entered the Jira URL, and i have checked the same set of users options.
Incoming link in confluence application is shown below.


The Error i get when I click the web item.

com.atlassian.applinks.api.CredentialsRequiredException: You do not have an authorized access token for the remote resource.
** at com.atlassian.applinks.oauth.auth.ThreeLeggedOAuthRequestFactoryImpl.retrieveConsumerToken(**
** at com.atlassian.applinks.oauth.auth.ThreeLeggedOAuthRequestFactoryImpl.createRequest(**
** at com.atlassian.applinks.core.auth.ApplicationLinkRequestFactoryFactoryImpl$AbsoluteURLRequestFactory.createRequest(**

My guess is that the impersonation is failing on the other end. I would check the logs there.

Thanks for the replies.

In Outgoing Authentication on the Jira Application, the checkbox was unchecked for “Enable Outgoing 2-Legged OAuth with Impersonation requests”.

Once checked, fixed my error.