Expand my Community achievements bar.

SOLVED

Obtain Target API access token

Avatar

Level 1

I have been walking through all the steps to get the Target API access token. I am stuck at this step - https://www.adobe.io/products/usermanagement/docs/createjwt

I get the 200 status from the server, and don't see no error, but the response does not return any information related to the access key or anything. The response body is empty. Does this mean there is something wrong? 

Thanks.

1 Accepted Solution

Avatar

Correct answer by
Level 1

Hi, 

I could finally get the correct response. It seems that my previous code could get the 200 success response, but actually it didn't pass the correct parameter and got the empty body response. 

Shouldn't the response be something else other than 200 if the body is empty? 

Thanks. 

View solution in original post

4 Replies

Avatar

Level 10

Hi,

Can you please provide more  details in terms of the  details of json request and response and that should help us further debug.

Thanks & Regards

Parit Mittal

Avatar

Correct answer by
Level 1

Hi, 

I could finally get the correct response. It seems that my previous code could get the 200 success response, but actually it didn't pass the correct parameter and got the empty body response. 

Shouldn't the response be something else other than 200 if the body is empty? 

Thanks. 

Avatar

Level 2
                I am having an issue obtaining an access token using JWT too. I am getting "JWT token is incorrectly formatted, and can not be decoded" error whatever JWT token I use. Here is an example request I am doing curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Cache-Control: no-cache" -d 'client_id=***&client_secret=***&jwt_token=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.EkN-DOsnsuRjRO6BxXemmJDm3HbxrbRzXglbN2S4sOkopdU4IsDxTI8jO19W_A4K8ZPJijNLis4EZsHeY559a4DFOd50_OqgHGuERTqYZyuhtF39yxJPAjUESwxk2J5k_4zM3O-vtd1Ghyo4IbqKKSy6J9mTniYJPenn5-HIirE' "https://ims-na1.adobelogin.com/ims/exchange/jwt" client_id and client_secret are obfuscated here, but they are correct when I'm getting the error since omitting or tampering one of them will result in a "client_id/client_secret are incorrect" error instead. Concerning the jwt_token, I tried various token, I tried base64 encoding the all token, etc. It is always returning the same "JWT token is incorrectly formatted" error. In the example, I used a JWT example from https://jwt.io/#debugger, so it is correctly formatted and can be decoded. I am not sure how is supposed to be formatted the jwt_token parameter value.

Avatar

Level 1

Similar issue I have "got the empty body response"