當我連接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