cancel
Showing results for 
Search instead for 
Did you mean: 

I wanted to authenticate via api in magento 2, what function can I use for authentication?

I wanted to authenticate via api in magento 2, what function can I use for authentication?

I tried to use Magento\Customer\Api\AccountManagementInterface::authenticate.

<route url="/V1/customers/auth_custom/:email/Smiley Tongueassword" method="GET">
<service class="Magento\Customer\Api\AccountManagementInterface" method="authenticate"/>
<resources>
<resource ref="anonymous"/>
</resources>
</route>

 

If I submit an existing email from magento using curl, (http://localhost/magento/index.php/rest/V1/customers/auth_custom/roni_cosst@example.com/123123)

it returns the matching email's data. but not matching the password. If I submit a non existing email, it will return this message. {"message":"Invalid login or password."}

 

Someone help me please. Many thanks