当我连接heroku postgres数据库与Auth0然后我越来越低于错误。如何连接postgres数据库与Auth0
could not connect to postgres db { [error: no pg_hba.conf entry for host "XXXXXXXX", user "XXXXXX", database "XXXXXX", SSL off]
name: 'error',
length: 161,
severity: 'FATAL',
code: '28000',
detail: undefined,
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'auth.c',
line: '496',
routine: 'ClientAuthentication' }
[error] 28000 - undefined
我使用的是Auth0,所以请在下面的auth0代码中使用heroku数据库的详细信息和URL。
configuration.config_file = "postgres://username:[email protected]:port/DB_name"
function login (email, password, callback) {
var conString = configuration.config_file;
postgres(conString, function (err, client) {
if (err) {
console.log('could not connect to postgres db', err);
return callback(err);
}
});
}
欢迎来到Stackoverflow。如果有任何问题,请发布错误消息。 – Daenarys 2015-04-02 09:08:43
您是否授予适当的权限以允许访问您的数据库? pg_hba.conf文件是访问权限似乎是您的服务器的IP没有在那里列出或没有适当的权限。 – 2015-04-02 10:10:18
@yakiklein你可以告诉我,当我们使用auth0访问heroku数据库时如何给予许可? – 2015-04-02 10:21:51