# How do get the access token and refresh token from the server side to work with salesforce api?

**URL:** <https://community.auth0.com/t/how-do-get-the-access-token-and-refresh-token-from-the-server-side-to-work-with-salesforce-api/7761>\
**Category:** Get Help\
**Tags:** salesforce, refresh-tokens, access-token\
**Created:** [August 5, 2017, 6:24am UTC](https://community.auth0.com/t/how-do-get-the-access-token-and-refresh-token-from-the-server-side-to-work-with-salesforce-api/7761 "2017-08-05T06:24:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![oren](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/oren/32/7851_2.png) [@oren](https://community.auth0.com/u/oren)\
**Post date:** [August 5, 2017, 6:24am UTC](https://community.auth0.com/t/how-do-get-the-access-token-and-refresh-token-from-the-server-side-to-work-with-salesforce-api/7761/1 "2017-08-05T06:24:51Z")

</div>

I have a spa that allows uses to access the system using the auth0 and lock libraries.  
I am unable to retrieve the refresh token nor the access token to allow me to work with the saleforce api to do offline operations.

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [August 8, 2017, 4:34pm UTC](https://community.auth0.com/t/how-do-get-the-access-token-and-refresh-token-from-the-server-side-to-work-with-salesforce-api/7761/2 "2017-08-08T16:34:17Z")

</div>

The process to obtain identity provider (IdP) access tokens that are generated as a by-product of end-user authentication through an external IdP is documented [here](https://auth0.com/docs/tokens/idp). The process requires a component in your system that can act as a confidential client and as such cannot be used directly by SPA’s as those are considered public clients.

In addition, obtaining refresh tokens is something that is not available for all external IdP as the refresh token is only stored for a subset of the available providers; the linked documentation above goes over that subset and it seems Salesforce is not included in the supported list.

---

<div class="post-metadata">

**Author:** ![oren](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/oren/32/7851_2.png) [@oren](https://community.auth0.com/u/oren)\
**Post date:** [August 8, 2017, 10:52pm UTC](https://community.auth0.com/t/how-do-get-the-access-token-and-refresh-token-from-the-server-side-to-work-with-salesforce-api/7761/3 "2017-08-08T22:52:07Z")

</div>

got it - thanks.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:55am UTC](https://community.auth0.com/t/how-do-get-the-access-token-and-refresh-token-from-the-server-side-to-work-with-salesforce-api/7761/4 "2018-03-02T05:55:47Z")

</div>


