# No access\_token in the returned user profile from Salesforce

**URL:** <https://community.auth0.com/t/no-access-token-in-the-returned-user-profile-from-salesforce/8213>\
**Category:** Get Help\
**Tags:** access\_token, saleforce\
**Created:** [September 16, 2017, 10:43pm UTC](https://community.auth0.com/t/no-access-token-in-the-returned-user-profile-from-salesforce/8213 "2017-09-16T22:43:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![lcheng\_nj](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@lcheng\_nj](https://community.auth0.com/u/lcheng_nj)\
**Post date:** [September 16, 2017, 10:43pm UTC](https://community.auth0.com/t/no-access-token-in-the-returned-user-profile-from-salesforce/8213/1 "2017-09-16T22:43:00Z")

</div>

I meet problem when trying to get `access_token` from Salesforce. The user profile returned from endpoint [https://lcheng.auth0.com/userinfo](https://lcheng.auth0.com/userinfo), doesn’t have `access_token` info, following is the identities field. `identities`:

```
{
  "isSocial": true,
  "provider": "salesforce",
  "user_id": "00590000002pYgSAAU",
  "connection": "salesforce"
}],

```

Following is what I have done

1. I have created one app in the Salesforce side, and configured the callback to `https://lcheng.auth0.com/login/callback`

2. The scope for `user_idp_tokens` is also configured, following is the result from Get all client grants API

3. I also tried endpoint, `https://lcheng.auth0.com/api/v2/users/00590000002pYgSAAU`, the “user\_id” is get from step 1. However, the response is:

---

<div class="post-metadata">

**Author:** ![lcheng\_nj](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@lcheng\_nj](https://community.auth0.com/u/lcheng_nj)\
**Post date:** [September 25, 2017, 12:09pm UTC](https://community.auth0.com/t/no-access-token-in-the-returned-user-profile-from-salesforce/8213/2 "2017-09-25T12:09:40Z")

</div>

Let me answer the question myself, to get access token from socal provider, e.g. salesforce in my case, I should use url https://{domain}/auth0.com/api/v2/users/{user\_id}.  
For salesforce, the user\_id should use “salesforce|00590000002pYgSAAU” rather than “00590000002pYgSAAU” and this part of url should be encoded. As a result, my previous third step has problem.

---

<div class="post-metadata">

**Author:** ![oliinyk.sergii](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@oliinyk.sergii](https://community.auth0.com/u/oliinyk.sergii)\
**Post date:** [October 8, 2017, 6:03am UTC](https://community.auth0.com/t/no-access-token-in-the-returned-user-profile-from-salesforce/8213/3 "2017-10-08T06:03:28Z")

</div>

Hi All, for any operation it sends  
{“statusCode”:400,“error”:“Bad Request”,“message”:“Object didn’t pass validation for format user-id: 59d957e570bcc74d810d8a4f”,“errorCode”:“invalid\_uri”}

---

<div class="post-metadata">

**Author:** ![oliinyk.sergii](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@oliinyk.sergii](https://community.auth0.com/u/oliinyk.sergii)\
**Post date:** [October 8, 2017, 6:03am UTC](https://community.auth0.com/t/no-access-token-in-the-returned-user-profile-from-salesforce/8213/4 "2017-10-08T06:03:28Z")

</div>

For any operation it sends  
`{"statusCode":400,"error":"Bad Request","message":"Object didn't pass validation for format user-id: 59d957e570bcc74d810d8a4f","errorCode":"invalid_uri"}`

---

<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:** [October 9, 2017, 6:29pm UTC](https://community.auth0.com/t/no-access-token-in-the-returned-user-profile-from-salesforce/8213/5 "2017-10-09T18:29:36Z")

</div>

Have you checked the details of the answer provided by @lcheng_nj ? It described that the cause for that error was the fact that an incomplete user identifier was being provided (missing a prefix).

---

<div class="post-metadata">

**Author:** ![oliinyk.sergii](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@oliinyk.sergii](https://community.auth0.com/u/oliinyk.sergii)\
**Post date:** [October 9, 2017, 6:57pm UTC](https://community.auth0.com/t/no-access-token-in-the-returned-user-profile-from-salesforce/8213/6 "2017-10-09T18:57:07Z")

</div>

I also tried with prefix, but it doesn’t recognize as well. What does it mean encoded, using what ? auth0|599c259e34126e181686e457 - tired this one  
By the way, why change password is not included in Java client library ?

---

<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:** [October 10, 2017, 8:34pm UTC](https://community.auth0.com/t/no-access-token-in-the-returned-user-profile-from-salesforce/8213/7 "2017-10-10T20:34:11Z")

</div>

I do not know of any concrete reason behind the lack of change password in the Java library, likely it’s just not yet been added. In relation to the identifier encoded was to refer that the value is passed in the URL so it needs to be URL-encoded. You can use an online encoder such as [this one](https://meyerweb.com/eric/tools/dencoder/).

---

<div class="post-metadata">

**Author:** ![oliinyk.sergii](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@oliinyk.sergii](https://community.auth0.com/u/oliinyk.sergii)\
**Post date:** [October 15, 2017, 2:22am UTC](https://community.auth0.com/t/no-access-token-in-the-returned-user-profile-from-salesforce/8213/8 "2017-10-15T02:22:59Z")

</div>

Add it to the documentation. There is no info that says encode it.

---

<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:56am UTC](https://community.auth0.com/t/no-access-token-in-the-returned-user-profile-from-salesforce/8213/9 "2018-03-02T05:56:32Z")

</div>


