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?

0

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": "test@example.com",
        "password": "Test@123"
    }

Response:

"bdw1x6cb3ntbdj6d4pqfzr8xksjezkv2"

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.