cancel
Showing results for 
Search instead for 
Did you mean: 

Adobe Commerce GraphQL API Authentication

Adobe Commerce GraphQL API Authentication

Hi to everyone

Currently i am working on Adobe Commerce GraphQL API, Does it has any authentication? Using No Auth i am able to get data from Postman. 

3 REPLIES 3

Re: Adobe Commerce GraphQL API Authentication

Hi @krishnendu9de9 

 

Yes, it has Authorization.

You may refer GraphQL authorization for more details.

 

Thanks

---
Problem Solved Click Accept as Solution!:Magento Community India Forum

Re: Adobe Commerce GraphQL API Authentication

Hi @Mukesh Tiwari 

 

But i am Getting the response without having any Authentication. Or Invalid Bearer Token from Postman, Is there any way to stop getting the response, from Adobe Commerce Web API, If User doesn't provide any authentication.

 

But for Specific Customer Details i need to Provide Customer token, How can i fetch customer data using Admin token? 

 

Thanks.

Re: Adobe Commerce GraphQL API Authentication

To generate the customer token you require to use generateCustomerToken

mutation {
  generateCustomerToken(email: "customer@example.com", password: "password") {
    token
  }
}

Output

 {
   "data": {
     "generateCustomerToken": {
       "token": "hoyz7k697ubv5hcpq92yrtx39i7x10um"
     }
   }
 }

If you update your question with the code you have used, you may get better responses from community members.

 

Referhttps://developer.adobe.com/commerce/webapi/graphql/usage/authorization-tokens/ 

---
Problem Solved Click Accept as Solution!:Magento Community India Forum