# We couldn't Authenticate with the credentials provided



## punnu07 (Oct 9, 2020)

All,

I am trying to fetch the live stocks data from NSE website and I have used the Data -> "From Web" function for the same. Below are the attributes which I have fetched from the site:

Source = Json.Document(Web.Contents("https://www.nseindia.com/api/equity-stockIndices?index=SECURITIES IN F&O", 
[Headers=[#"accept-encoding"="gzip, deflate", 
                 #"accept-language"="en-IN,en-GB;q=0.9,en-US;q=0.8,en;q=0.7", 
                 #"user-agent"="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36",                                Cookie="A9A56C0BC357FC0510E4F82EA12DED02~bK5MfvH2x374rR/o1GKLSyyo2Vb22v0uHhFRPUEn/7Uj+xivH+sI2DrNX/0AxoV08EOEqnD3lVDo/w5IASQP1yX4bDlKmWxpXabu9ZEZgIXMUIaULSt+7Y2VpXE0Ujmdb4GqSujPO5oD/cF4+0p/VhsLiXTgqOdtKrKfV7Uzzqw="]])),

I am able to fetch the required table/data into the excel; however constantly I am getting below error (screenshot attached);

We couldn't authenticate with the credentials provided. Please try again.

Sometimes after just one click on connect, data get refreshed; however sometimes even after clicking 15 20 time, it is not connected.

Please help me in resolving this issue.


----------



## smozgur (Oct 9, 2020)

You need to refresh Cookie since It is expired at a certain time. Open the web page in the browser and copy the new cookie string.


----------



## punnu07 (Oct 16, 2020)

smozgur said:


> You need to refresh Cookie since It is expired at a certain time. Open the web page in the browser and copy the new cookie string.


Thank you for your reply. Is there any way to update the cookie automatically because manually it takes a lot of time.


----------

