Expand my Community achievements bar.

While using AEM in local setup, what token credentials should I put in?

Avatar

Level 2

I am trying to use local node client thats available at https://experienceleague.adobe.com/docs/experience-manager-learn/assets/aem-guides_token-authenticat...

 

I see that we have a params object which is expected to have `developerCredentials` field:

 

```

// Command line parameters
let params = { };

/**
* Application entry point function
*/
(async () => {
console.log('Example usage: node index.js aem=https://author-p1234-e5678.adobeaemcloud.com propertyName=metadata/dc:rights propertyValue="WKND Limited Use" folder=/wknd/en/adventures/napa-wine-tasting file=credentials-file.json' );

// Parse the command line parameters
params = getCommandLineParams();
 
// Set the access token to be used in the HTTP requests to be local development access token
params.accessToken = await getAccessToken(params.developerConsoleCredentials);

// Get a list of all the assets in the specified folder
let assets = await listAssetsByFolder(params.folder);

// For each asset, update it's metadata
await assets.forEach(asset => updateMetadata(asset, {
[params.propertyName]: params.propertyValue
}));
})();

```

 

while developing locally, I wanted to know how can I connect to AEM that's running on localhost:4502. Do I need to have local access token generated from cloud for this as well since I am just using `localhost` server and nothing from AEM cloud.

5 Replies

Avatar

Community Advisor

Hi,

To connect local AEM , you can use the AEM login credentials when you make request.

But if you are using AEM publish instance then you can connect without any credentials.



Arun Patidar

Avatar

Level 2

I didn't completely get you when you say login credentials. I have set login credentials as admin and admin, now I want to make a request to a given graphQL endpoint,

do I keep it as `Bearer username:password` in Authorization or should I do something else?

Avatar

Level 7
You can easily do the Basic AUthentication for local instace and Token based for AEM which is hosted on cloud.
For instance - When we want to access an endpoint from our AEM instance using POSTMAN, we need to set the Authentication information via  tab -> "Authorization" with respective Type. (Which would help generate an Authorization Header for making an HTTP request)
  • For Classic AEM instance, we need to use "Basic" Type -> respective Username and Password input as we would give in our AEM instance.
  • For AEMasCS instance(the one as hosted in cloud and NOT Cloud Service SDK instance), we need to use Token Based Authentication -> "Bearer" Type -> Token value as input. Which you already know.

Avatar

Level 2

Currently, I am only running the AEM JAR file locally on my system, I want to connect to the same and utilise GQL endpoints. For that can you tell me what I need to do, if I want to make request from postman?

Avatar

Community Advisor

Hi @shivam-rally , What are you trying to achive here. Do you want to perform any remote operation in AEM.  You can perform using postman using basic authrntication(user/password).
check my comment here-

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/create-page-site-from-a-si...

Or if you are interested, Check this video tutorial -
https://youtu.be/rCoGndHr7HQ