0
我登記在Auth0用戶登錄(在儀表板的用戶選擇) 我用下面的代碼來認證用戶(具有用戶名和密碼一個HTML表格)Auth0登錄認證
public login(username: string, password: string): void {
this.auth0.redirect.loginWithCredentials({
connection: 'Username-Password-Authentication',
username,
password
}, err => {
if (err) return alert(err.description);
});
}
,它完美運作。 但是,由於redirect.loginWithCredentials的棄用,我想使用client.login,但它不起作用。這是我的代碼
this.auth0.client.login({
realm: 'Database',
grant_type: 'http://auth0.com/oauth/grant-type/password-realm',
username,
password,
scope: 'openid profile',
}, err => {
if (err) return alert(err.description);
});
我認爲問題是領域的名稱。使用我在Auth0中創建的用戶的領域名稱是什麼?
謝謝所有
有助於瞭解您正在使用的auth0.js庫的版本。你有沒有嘗試把你的數據庫連接的名稱作爲領域價值,即。用戶名密碼認證(在這裏發表評論,而不是一個答案,因爲我沒有明確檢查) – arcseldon
感謝它是v 8.8.0 –
嗨,我的答案下面解決您的問題? – arcseldon