![](/img/trans.png)
[英]Access the authenticated user with ember app, rails api, and ember-cli-simple-auth-devise addon
[英]ember simple auth with rails devise username instead of email?
我有一個devis用於登錄例程的rails api。 我通過ember simple auth將ember插入其中。 使用典型的設計電子郵件和密碼啟動並運行。 我通常將devise配置為使用LDAP身份驗證,但效果很好。 我遇到的問題是我使用用戶名進行LDAP登錄,而不是電子郵件地址。 我通常會更改設計以查找用戶名而不是我已經完成的電子郵件地址。
我現在收到未經授權的401,並查看參數,好像我仍在發送電子郵件。
您可以更改ember簡單身份驗證以發送用戶名而不發送電子郵件嗎? 如果是這樣,您該怎么做?
您必須擴展設計授權者,並將identificationAttributeName
設置為username
// app/authorizers/devise.js
import DeviseAuthorizer from 'ember-simple-auth/authorizers/devise';
export default DeviseAuthorizer.extend({
identificationAttributeName: 'username'
});
資料來源: ember-simple-auth
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.