# Impossible to connect with Imgur

**URL:** <https://community.auth0.com/t/impossible-to-connect-with-imgur/59107>\
**Category:** Get Help\
**Tags:** api, auth0\
**Created:** [March 9, 2021, 10:00am UTC](https://community.auth0.com/t/impossible-to-connect-with-imgur/59107 "2021-03-09T10:00:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheYakuzo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/theyakuzo/32/12681_2.png) [@TheYakuzo](https://community.auth0.com/u/TheYakuzo)\
**Post date:** [March 9, 2021, 10:00am UTC](https://community.auth0.com/t/impossible-to-connect-with-imgur/59107/1 "2021-03-09T10:00:05Z")

</div>

Hello,

The problem I have is that it is impossible for me to perform a conclusive connection test with Imgur.  
Indeed, I get the following error:  
{  
“error”: “invalid\_request”,  
“error\_description”: “Invalid user id.”  
}  
I did put the ID Client and Secret Client generated by Imgur on the Imgur service of OAuth0 but it doesn’t work.  
I don’t understand where this problem comes from.  
Thank you in advance!

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [March 9, 2021, 1:37pm UTC](https://community.auth0.com/t/impossible-to-connect-with-imgur/59107/3 "2021-03-09T13:37:44Z")

</div>

Hi @TheYakuzo,

Welcome to the Community!

I just tried out the Imgur social connection, and I got the same error. I am going to reach out to the team responsible for social connections. It might be related to configuration settings.

I was able to create a custom connection for Imgur:

- Go to social connections and click “+ CREATE CONNECTION”
- Click “Create Custom” at bottom of list of social connections
- Authorization URL: [https://api.imgur.com/oauth2/authorize](https://api.imgur.com/oauth2/authorize)
- Token URL: [https://api.imgur.com/oauth2/token](https://api.imgur.com/oauth2/token)
- Scope: leave blank
- Client ID: YOUR\_IMGUR\_APPLICATION\_CLIENT\_ID
- Client Secret: YOUR\_IMGUR\_APPLICATION\_CLIENT\_SECRET
- Fetch User Profile Script:

```auto
function fetchUserProfile(accessToken, context, callback) {
  request.get(
    {
      url: 'https://api.imgur.com/3/account/me',
      headers: {
        'Authorization': 'Bearer ' + accessToken,
      }
    },
    (err, resp, body) => {
      if (err) {
        return callback(err);
      }

      if (resp.statusCode !== 200) {
        return callback(new Error(body));
      }

      let bodyParsed;
      try {
        bodyParsed = JSON.parse(body);
      } catch (jsonError) {
        return callback(new Error(body));
      }

      const profile = {
        user_id: `${bodyParsed.data.id}`
      };

      callback(null, profile);
    }
  );
}

```

---

<div class="post-metadata">

**Author:** ![TheYakuzo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/theyakuzo/32/12681_2.png) [@TheYakuzo](https://community.auth0.com/u/TheYakuzo)\
**Post date:** [March 9, 2021, 2:59pm UTC](https://community.auth0.com/t/impossible-to-connect-with-imgur/59107/4 "2021-03-09T14:59:09Z")

</div>

Thank you ! It work for me !

---

<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 24, 2021, 2:59pm UTC](https://community.auth0.com/t/impossible-to-connect-with-imgur/59107/5 "2021-03-24T14:59:40Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
