Expand my Community achievements bar.

Analytics API 2.0: Failure while try to use access token generated with jwt token

Avatar

Level 1

Hi all,

we want to call the Analytics API 2.0 from our Java application. Therefor we generate an JWT token and with that JWT token an access token in Java. We used this tutorial:  https://www.adobe.io/authentication/auth-methods.html#!adobeio/adobeio-documentation/master/auth/JWT...  https://www.adobe.io/authentication/auth-methods.html#!adobeio/adobeio-documentation/master/auth/JWT...

Now we try to get a report from Analytics API with this access token but we always get the following error:

{"errorCode":"invalid_token","errorDescription":"User associated with ims token could not be found or company not found.","errorId":"auth-xxxx-xxxx"}

In case we use an access token generated with OAuth (and user credentials), the request to the /reports endpoint works well. We couldn't find a way to generate an OAuth access token programmatically without manually login at Adobe. So we used the JWT Token in Java.

We use the Analytics API 2.0: https://adobedocs.github.io/analytics-2.0-apis/ and want to use the /reports endpoint.

Is there a way to automatically generate an access token to authenticate with api 2.0 and do a reports request?

Thanks a lot

Tobias

5 Replies

Avatar

Level 3

Looking for the same, kindly respond.

I was going through Adobe IO documentation for Analytics API 2.0 and found that there are 2 ways of creating access token i.e. JWT or OAuth.

  • - Using Postman, I am able to get access token using OAuth method, but how can I do it programmatically, kindly share.

Response is :-

{

"errorCode": "invalid_token",

"errorDescription": "User associated with ims token could not be found or company not found.",

"errorId": "auth-xxxxxx-xxxx-xxxx-xxxx-xxxxxx"

}

Kindly help.

Avatar

Level 1

Meanwhile I got some information from Adobe that the JWT support will be available beginning next year. But there is no fix date for that.

I saw in the Readme from analytics-2.0-apis: "Note: JWT Authentication is coming soon."

GitHub - AdobeDocs/analytics-2.0-apis: Documentation for the Adobe Analytics 2.0 APIs

Avatar

Level 3

Thanks, yes I saw the same, but I am looking the programatic way to generate token, OAuth 2.0 method would also work for the time being.

Hi,

Do you have any additional information in relation to this?

I tried to use the JWT Authentication and still doesn't work

Regards,

Avatar

Level 1

Hi All,

 

Is there a way to programmatically generate an access token using any method? Kindly help its urgent