0

I would like to use the Rest API to get a client token first. And then use this token to login as Magento2 client. E.g. domain.com? customerToken = xyz

Are there any ready-made methods / modules for this in Magento2? I can probably call the magento rest api from the magento module (call the rest api from magento itself) to verify token is correct, but there is probably some other better solution?

SantiBM
1,39015 silver badges31 bronze badges
asked Jun 17, 2021 at 15:24

1 Answer 1

1

You can try Login API:
integrationCustomerTokenServiceV1:

Interface providing token generation for Customers
POST /V1/integration/customer/token

API URL: {baseurl}/rest/V1/integration/customer/token

Method: POST

Body:

{
 "username": "[email protected]",
 "password": "Test@123"
 }

Response:

"bdw1x6cb3ntbdj6d4pqfzr8xksjezkv2"

Reference : https://devdocs.magento.com/guides/v2.4/get-started/authentication/gs-authentication-token.html

answered Jul 8, 2021 at 9:40

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.