LocalStorage access_token

Hi Team,
The API token we use getting an error and when checked with document it is said we need to take that from local storage but we cannot locate any that is matching the .fdk folders token value.
image


Looking forward to your reply.

Hi Manikandan,
Welcome to forum! Hope you are doing well.!
For account level oauth, we will be storing the token in .fdk/localstorage, but for a agent level oauth we will be storing the token in browser’s localstorage. You can check the type of oauth at the config/oauth_config.json under token_type.
It will also be useful if you can share what error you are getting…

1 Like

Hi Chandiramouli Ramachandran,
As you suggested used the token type as agent and authorized the app, then by searching in browser localstorage ‘app_123456789_123456789’ which has access_token and refresh_token, I used to make a api call using that token in postman looks like that token is in valid.

Thanks for the details Manikandan. For an agent oauth, you can find the token in the browser local storage. Are you facing any authorization issue when making a request?

1 Like

Hi Chandiramouli Ramachandran,
Here are the screen short attached please check them.
This access_token given from the loaclstorage in browser.

This access_toekn given from the .fdk/loaclstore .


For security reasons, we will be storing the encrypted tokens in the browser. While making a through client.request or $request, we will be decrypting in our backend and make the corresponding request.

1 Like

Hi Chandiramouli Ramachandran,
As you suggested used ‘console.log(client.request);’ also used ‘client.request.tokens,access_tokens,app_123456789_123456789’ can’t able to the access token

screen short for console.log(client.request)

You will not be able to use the token directly, please refer to the document : OAuth . For the request requiring OAuth, you just need to pass the isOAuth : true flag and we will be passing the token as part of the request

1 Like

Hi Chandiramouli Ramachandran,
Access the token like <%= access_token %> and also pass the query param as isOAuth :true;
image
image

Hi Manikandan,

  • You will not be able to access the token value from browser.
  • You should use the platform’s request (client.request or $request) so the OAuth flow works
  • Also, please refer the OAuth. The OAuth flag should be passed as part of header
1 Like

Hi Chandiramouli Ramachandran,

Timeout error

image

Hi Manikandan,
We have a 6s timeout for request made through request api. I suppose it should be due the server taking more than 6s to respond.