How to do Http Basic access authentication from advance rest client

rajasekhar picture rajasekhar · May 17, 2016 · Viewed 28.5k times · Source

I am trying to do basic authentication to call a rest service.

On service doc the procedure mentioned for CURL is like this

curl -X POST https://secure.clientservice.com/api/transactions.json -u [TOKEN]:[KEY] -H 'Content-type: application/json' \
-d "{\"transaction_type\":\"request\",\"amount_in_cents\":\"3000\",\"email\":\"[email protected]\"}"

I got stuck how to send the [TOKEN]:[KEY] for authentication from chrome rest client.I am having both user token and key and doc is saying i have to do Http Basic access authentication

On rest explorer i am trying like below

enter image description here

But this is giving un authorized access as seems to be the Authorization header is wrong where i am encoding [axkKtfBAaPABCh59SA]:[S7RwBG2eZ3y8mDs8VS] this value to base 64. Am i doing in right way or am i missing something.

Answer

sag picture sag · May 17, 2016

Add the Authorization header: Header Forms --> ADD HEADER --> Begin typing in Authorization.

enter image description here

and add the basic auth info by clicking on the Edit (pencil) button on the right. A form to fill credentials will pop up: enter image description here

Advanced REST Client will take care of encoding