Expand my Community achievements bar.

SOLVED

Query Regarding Workfront APIs Authentication

Avatar

Level 1

Hi all,

We have a specific use case where we want to leverage Workfront-related APIs, such as "attask/api/v15.0/user/search" and "attask/api/v15.0/user?id={user_id}." To set up this functionality, we followed the guidance provided in this link [https://experienceleague.adobe.com/docs/workfront/using/adobe-workfront-api/workfront-api.html]


The process involved several steps. First, we created an Integration App for OAuth from our console and generated a pair of public and private keys for asymmetric encryption. Subsequently, we used the Customer ID and User ID from the app to create a JWT token, which was then signed with the private key. Once we had the JWT token, we made use of this API endpoint: https://yourdomain.my.workfront.com/integrations/oauth2/api/v1/jwt/exchange to obtain an access token, which we successfully acquired.

 

However, when we attempted to access the aforementioned APIs using the obtained access token and included it as a Bearer token in the authorization header, we encountered authentication issues. The error message we received was:
{
    "error": {
        "class": "com.attask.common.AuthenticationException",
        "message": "Authentication Exception: Authentication Exception: {0}"
    }
}

I would greatly appreciate any assistance in resolving this matter. Please guide me on how to correctly use the access token for authentication and API access. If I have overlooked something or made an error, your guidance would be invaluable.


Thanks.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

 

Sorry. I made a mistake recently and double checked my code.

 

Instead of

'Authorization': 'sessionID ' + <bearer token>,

 

You need to use the following header:

'sessionID': <bearer token>

 

So you don't need the keyword Authorization here.

 

I tried my API call with the wrong header and do get exactly the same error message as you. Using my corrected version it is working.

 

Regards

Lars

View solution in original post

4 Replies

Avatar

Level 10

Hello rjwaji,

 

Although I have no experiences with the JWT token, as I am using OAuth Authorization Code Flow, can you please check, if you used the keyword sessionID in your Authorization header in front of your token? I made the experience, that it does work using 

 

 

'Authorization': 'sessionID ' + <bearer token>,

 


but not the common way:

 

'Authorization': 'Bearer ' + <bearer token>,

 

 

Regards

Lars

Avatar

Level 1

Hi,

 I tried, getting the same error. what authentication flow you using?

Avatar

Correct answer by
Level 10

Hi,

 

Sorry. I made a mistake recently and double checked my code.

 

Instead of

'Authorization': 'sessionID ' + <bearer token>,

 

You need to use the following header:

'sessionID': <bearer token>

 

So you don't need the keyword Authorization here.

 

I tried my API call with the wrong header and do get exactly the same error message as you. Using my corrected version it is working.

 

Regards

Lars

Avatar

Level 1

Thanks @lgaertner