Allowing Okta connection to our custom DB

0

Hello all. We have an EC2 server with a SQL database installed. I am trying to connect to that database with a single sign on service(Okta using OAuth). I have completed the steps on the Okta side to get connected (Server IP, Database Name, User Name and Password). I get back a 401 error in the console.

I have set incoming rules for the ip addresses they recommend in the security group for the EC2 server. I have checked to make sure Windows defender allows the correct ports to connect (1433).

If I get the Server IP incorrect, I get a cannot connect to server error. When I have the IP correct, the login script they provide for logging in gives a different error. That error states (Cannot read properties of undefined (reading '2') from this line - bcrypt.compare(password, rows[0][2].value, function (err, isValid) {.....}. This line is from a script Okta provides to log in as a specific user.

Any help would be appreciated as Okta's tech folks could not tell me why the connection is returning a 401.

Gwhitch
asked 10 months ago285 views
1 Answer
0

Console/log the rows matrix to make sure has valid values, as it doesn’t seem so.

profile picture
EXPERT
answered 10 months ago
  • According to Okta tech support, he was stating that the connection did not seem to happen. My thinking is, the line that seems to be generating the error is in the connection.on('connect', function (err) {.....}). I would think if the logic is executing to the point of not reading that value, the connection has been made.

  • The console.log does not do anything. I have put a call to console.log() in a few places within the script and either they never get reached in the logic or has no affect at all.

  • Yes, it seems it cannot establish a connection

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions