Expand my Community achievements bar.

SOLVED

Invalid api key

Avatar

Level 1

Hi there,

I was testing out the request in the process of the OAuth authentication, however, I am stuck with the step 6 in the following guide: https://developer.adobe.com/developer-console/docs/guides/authentication/ServerToServerAuthenticatio...

Upon making the request (while replacing the values as mentionned):

curl -X GET 'https://api.adobe.io/console/organizations/{orgId}/credentials/{credentialId}/secrets' \
-H 'Authorization: Bearer {ACCESS TOKEN GENERATED IN STEP 5}'
-H 'x-api-key: {CLIENT ID FROM STEP 6}'

I systematically get an:

{
    "error_code": "403003",
    "message": "Api Key is invalid"
}

Which is strange, since I use the same client_id I use for the access-key-generation-request:

curl -X POST 'https://ims-na1.adobelogin.com/ims/token/v3' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'client_id={CLIENT_ID}&client_secret={CLIENT_SECRET}&grant_type=client_credentials&scope={SCOPES}'

And which generates the access_key correctly (the one I then use as the bearer in the request of step 6).
I am not sure why the error message is "Api Key is invalid", does anyone have a clue ?
Worth mentionning:

- We still have not deleted the JWT authentication;
- I played around with different version of the scopes to include in the access-key-generation-request, but I might be missing an important scope, could it be that I am missing an important scope (not sure then which one) ?

- Does the client need to have some previleges we'd need to activate on the developer console ?

Thanks

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @ElTaureauDeBully 

To troubleshoot and potentially resolve the "Api Key is invalid" error:

  1. Verify API Key: Double-check that the x-api-key value in your request matches the API key associated with your Adobe Developer Console project. Ensure that there are no typos or errors in this value.

  2. API Key Configuration: Make sure that the API key in your Adobe Developer Console is properly configured and enabled for the specific API or resource you are trying to access.

  3. Scope Permissions: Review the scopes you are requesting during the access token generation process. Ensure that you have included the necessary scopes to access the Adobe API you are trying to use.

  4. JWT Authentication: If you are using both JWT (JSON Web Token) authentication and OAuth authentication in the same project, ensure that they are configured separately and do not conflict with each other. Make sure that JWT authentication is properly set up and not interfering with the OAuth authentication process.

  5. Developer Console Settings: Check your Adobe Developer Console project settings and make sure that all necessary configurations are in place. Pay attention to any specific requirements or settings related to the Adobe API you are using.

  6. Contact Adobe Support: If you have followed these steps and are still experiencing the issue, consider reaching out to Adobe Support for assistance. They can provide you with specific guidance and troubleshoot any account or configuration issues you may be facing.

Please keep in mind that specific configurations and issues can vary, so it's important to carefully review your setup in the Adobe Developer Console and refer to Adobe's documentation or support resources for the most accurate and up-to-date information related to your case.

 

Thanks 

 
 
 
 

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

Hi @ElTaureauDeBully 

To troubleshoot and potentially resolve the "Api Key is invalid" error:

  1. Verify API Key: Double-check that the x-api-key value in your request matches the API key associated with your Adobe Developer Console project. Ensure that there are no typos or errors in this value.

  2. API Key Configuration: Make sure that the API key in your Adobe Developer Console is properly configured and enabled for the specific API or resource you are trying to access.

  3. Scope Permissions: Review the scopes you are requesting during the access token generation process. Ensure that you have included the necessary scopes to access the Adobe API you are trying to use.

  4. JWT Authentication: If you are using both JWT (JSON Web Token) authentication and OAuth authentication in the same project, ensure that they are configured separately and do not conflict with each other. Make sure that JWT authentication is properly set up and not interfering with the OAuth authentication process.

  5. Developer Console Settings: Check your Adobe Developer Console project settings and make sure that all necessary configurations are in place. Pay attention to any specific requirements or settings related to the Adobe API you are using.

  6. Contact Adobe Support: If you have followed these steps and are still experiencing the issue, consider reaching out to Adobe Support for assistance. They can provide you with specific guidance and troubleshoot any account or configuration issues you may be facing.

Please keep in mind that specific configurations and issues can vary, so it's important to carefully review your setup in the Adobe Developer Console and refer to Adobe's documentation or support resources for the most accurate and up-to-date information related to your case.

 

Thanks 

 
 
 
 

Avatar

Level 1

Were you able to resolve this issue? I am currently experiencing the exact same issue and the exact same scenario you mentioned. 

Avatar

Level 1

Same here. The client ID that was used to generate the token is being used to call the API.

I got the access token as expected but the generate API is throwing this error. {'error_code': '403003', 'message': 'Api Key is invalid'}