# Whitelist of ips for connection to mssql

**URL:** <https://community.auth0.com/t/whitelist-of-ips-for-connection-to-mssql/20255>\
**Category:** Get Help\
**Tags:** login\
**Created:** [January 20, 2019, 5:14pm UTC](https://community.auth0.com/t/whitelist-of-ips-for-connection-to-mssql/20255 "2019-01-20T17:14:46Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![SMen](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/smen/32/10263_2.png) [@SMen](https://community.auth0.com/u/SMen)\
**Post date:** [January 20, 2019, 5:14pm UTC](https://community.auth0.com/t/whitelist-of-ips-for-connection-to-mssql/20255/1 "2019-01-20T17:14:46Z")

</div>

My hosting provider has asked me to confirm that _all_ the IP’s need to be whitelisted in order to connect to my mssql database using the sqlServer script.

[Auth0 IP range for Azure Sql Server](http://community.auth0.com/t/auth0-ip-range-for-azure-sql-server/9090) seems to suggest it, but they are surprised by the number which I am listing here.

52.28.56.226,  
52.28.45.240,  
52.16.224.164,  
52.16.193.66,  
34.253.4.94,  
52.50.106.250,  
52.211.56.181,  
52.213.38.246,  
52.213.74.69,  
52.213.216.142,  
35.156.51.163,  
35.157.221.52,  
52.28.184.187,  
52.28.212.16,  
52.29.176.99,  
52.57.230.214

many thanks if you could confirm for them.

---

<div class="post-metadata">

**Author:** ![charsleysa](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/charsleysa/32/9722_2.png) [@charsleysa](https://community.auth0.com/u/charsleysa)\
**Post date:** [January 21, 2019, 12:40am UTC](https://community.auth0.com/t/whitelist-of-ips-for-connection-to-mssql/20255/2 "2019-01-21T00:40:27Z")

</div>

Yes, all the IP addresses need to be whitelisted as a request could come from any one of them.

The most up-to-date list of the IP addresses will be available from your Auth0 Management Dashboard.

---

<div class="post-metadata">

**Author:** ![SMen](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/smen/32/10263_2.png) [@SMen](https://community.auth0.com/u/SMen)\
**Post date:** [January 24, 2019, 11:11am UTC](https://community.auth0.com/t/whitelist-of-ips-for-connection-to-mssql/20255/3 "2019-01-24T11:11:35Z")

</div>

Many thanks. Will pass on.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [January 24, 2019, 11:22am UTC](https://community.auth0.com/t/whitelist-of-ips-for-connection-to-mssql/20255/4 "2019-01-24T11:22:35Z")

</div>

Let us know if you got it working or if you need any further help!

---

<div class="post-metadata">

**Author:** ![SMen](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/smen/32/10263_2.png) [@SMen](https://community.auth0.com/u/SMen)\
**Post date:** [January 24, 2019, 3:04pm UTC](https://community.auth0.com/t/whitelist-of-ips-for-connection-to-mssql/20255/5 "2019-01-24T15:04:27Z")

</div>

Hi, yes thank you, I have been asked this by the hosting engineers:

Is there any way that auth0 would be able to provide a Traceroute from their end? The Fact that it can come from that many IP’s makes it difficult on our end to investigate the issue to see what might be causing this, but a Traceroute may give us more info to go from if at all possible.

Is that possible?

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [January 24, 2019, 4:07pm UTC](https://community.auth0.com/t/whitelist-of-ips-for-connection-to-mssql/20255/6 "2019-01-24T16:07:18Z")

</div>

Hey @SMen!

I asked internally and it seems like this option is possible for paid users.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [January 24, 2019, 4:21pm UTC](https://community.auth0.com/t/whitelist-of-ips-for-connection-to-mssql/20255/7 "2019-01-24T16:21:16Z")

</div>

**BUT** 🙂

We are on AWS and you may try a trace route from a test server of your own in AWS. This might not be helpful for a lot of cases but still it is something you can try.

[https://dnslytics.com/ip/52.28.56.226](https://dnslytics.com/ip/52.28.56.226)

Hope it helps some way!

---

<div class="post-metadata">

**Author:** ![SMen](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/smen/32/10263_2.png) [@SMen](https://community.auth0.com/u/SMen)\
**Post date:** [January 24, 2019, 4:34pm UTC](https://community.auth0.com/t/whitelist-of-ips-for-connection-to-mssql/20255/8 "2019-01-24T16:34:06Z")

</div>

OK thank you - it is slightly chicken and egg! Considering the developer option as sole developer, but want to connect to my db! I will pass this on, and many thanks for your help.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [January 24, 2019, 4:42pm UTC](https://community.auth0.com/t/whitelist-of-ips-for-connection-to-mssql/20255/9 "2019-01-24T16:42:04Z")

</div>

Sure let me know what you establish! Will try to provide you with any potential knowledge and support we can offer!

---

<div class="post-metadata">

**Author:** ![SMen](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/smen/32/10263_2.png) [@SMen](https://community.auth0.com/u/SMen)\
**Post date:** [January 25, 2019, 11:01am UTC](https://community.auth0.com/t/whitelist-of-ips-for-connection-to-mssql/20255/10 "2019-01-25T11:01:28Z")

</div>

The engineers have come back saying that nothing is blocking the connection and if I deliberately misspell a column name I am alerted to the column name being incorrect

e.g. Invalid column name ‘mispelledColumnName’)

which suggests that I am in fact connecting.

If I connect live, I am told the username or password is incorrect even though they are correct.  
When using the testing system I just get ‘401 - Unauthorized’

Is there anything else I could be missing? The script is the sqlServer template.

function login(email, password, callback) {  
//this example uses the “tedious” library  
//more info here: [http://pekim.github.io/tedious/index.html](http://pekim.github.io/tedious/index.html)  
var connection = sqlserver.connect({  
userName: ‘correctusername’,  
password: ‘correctpassword’,  
server: ‘serverIPaddress’,  
options: {  
database: ‘correctDB’,  
rowCollectionOnRequestCompletion: true  
}  
});

var query = "SELECT UserID, AdminContactFirstName, Username, Password " +  
“FROM tbl\_Users WHERE Username = @Email”;

connection.on(‘debug’, function (text) {  
console.log(text);  
}).on(‘errorMessage’, function (text) {  
console.log(JSON.stringify(text, null, 2));  
}).on(‘infoMessage’, function (text) {  
console.log(JSON.stringify(text, null, 2));  
});

connection.on(‘connect’, function (err) {  
if (err) return callback(err);

```
var request = new sqlserver.Request(query, function (err, rowCount, rows) {
  if (err) {
    callback(new Error(err));
  } else if (rowCount < 1) {
    callback(new WrongUsernameOrPasswordError(email));
  } else {
    bcrypt.compare(password, rows[0][3].value, function (err, isValid) {
      if (err) { callback(new Error(err)); }
      else if (!isValid) { callback(new WrongUsernameOrPasswordError(email)); }
      else {
        callback(null, {
          user_id: rows[0][0].value,
          nickname: rows[0][1].value,
          email: rows[0][2].value
        });
      }
    });
  }
});

request.addParameter('Email', sqlserver.Types.VarChar, email);
connection.execSql(request);

```

});  
}

---

<div class="post-metadata">

**Author:** ![SMen](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/smen/32/10263_2.png) [@SMen](https://community.auth0.com/u/SMen)\
**Post date:** [January 25, 2019, 11:19am UTC](https://community.auth0.com/t/whitelist-of-ips-for-connection-to-mssql/20255/11 "2019-01-25T11:19:41Z")

</div>

I am wondering if it is the use of bcrypt.compare

---

<div class="post-metadata">

**Author:** ![SMen](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/smen/32/10263_2.png) [@SMen](https://community.auth0.com/u/SMen)\
**Post date:** [January 25, 2019, 11:42am UTC](https://community.auth0.com/t/whitelist-of-ips-for-connection-to-mssql/20255/12 "2019-01-25T11:42:06Z")

</div>

Yes it is the bcrypt.compare.

---

<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:** [February 9, 2019, 11:42am UTC](https://community.auth0.com/t/whitelist-of-ips-for-connection-to-mssql/20255/13 "2019-02-09T11:42:06Z")

</div>

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