I Have generated a token for API calls by using following code :
curl -X POST "http://magento2.ce/rest/V1/integration/customer/token"\
-H "Content-Type:application/json"\
-d '{"username":"john@change.me", "password":"abc123"}'
-How to set expiry time for this token?
-Can we generate token by using username? with out password.
Best Answer
Install Magento from github.com/magento/magento2.git and then use the steps from documentation page about Token-based authentication
On Github, you should look on branch '2.2.0-preview' or 'develop' or any other that uses the codebase of 2.2.0 or higher (develop is active branch by default).
This feature probably will be backported on Magento 2.1.9 and other versions.
Here is how it should look like: