Try this to perform basic authentication by URL:
curl -i http://username:password@dev.myapp.com/api/users -H "Authorization: Bearer mytoken123" ^^^^^^^^^^^^^^^^^^
If the above one does not work, then you have nothing to do with it. Therefore, try the following alternatives.
You can transfer the token under a different name. Because you are processing authorization from your Application. Thus, you can easily use this flexibility for this special purpose.
curl -i http://dev.myapp.com/api/users \ -H "Authorization: Basic Ym9zY236Ym9zY28=" \ -H "Application-Authorization: mytoken123"
Notice that I changed the title to Application-Authorization . Therefore, from your application, catch the token under this heading and process what you need to do.
Another thing you can do is pass token parameters through POST and capture the parameter value from the server side. For example, passing a token with the curl post parameter:
-d "auth-token=mytoken123"
Sabuj Hassan Mar 21 '14 at 17:04 2014-03-21 17:04
source share