我有一個應用程序已運行使用CredentialsAuthProvider()一段時間。ServiceStack Twitter身份驗證和註冊
今天,我想添加twitter和facebook作爲人們創建帳戶的選項。我有腳手架。
//Register all Authentication methods you want to enable for this web app.
Plugins.Add(new AuthFeature(() => new AuthUserSession(),
new IAuthProvider[] {
new CredentialsAuthProvider(),
new TwitterAuthProvider(appSettings),
new FacebookAuthProvider(appSettings)
}));
//Provide service for new users to register so they can login with supplied credentials.
Plugins.Add(new CustomRegistrationFeature());
端點/ API /認證/ Twitter和/ API/auth /中Facebook的工作,我看到一個用戶會話訪問/ API/AUTH創建一次OAuth的過程完成後無論其...
我的UserAuthRepository(OrmLiteAuthRepository)中沒有創建用戶。存儲在會話中的用戶標識無效。任何使用[Authenticate]屬性裝飾的方法都會導致返回404(用戶未找到)錯誤。
我期望用戶通過從Facebook或Twitter獲得的First/Last/Email創建用戶。我誤解了什麼嗎?
ServiceStack v4.0.38
如果仍有問題,請嘗試創建一個最小項目來突出顯示問題並在此處發佈鏈接。 – 2015-04-10 02:48:44
好吧,我會那樣做。我在旅行時本週無法獲得任何設置,但會盡快獲得幫助。 問題的癥結在於Session正在由Twitter提供程序創建,但數據庫沒有將用戶添加到該提供程序中。 現在它只是在我的redis會話存儲中創建一個ID爲== 1的用戶,但在我的auth倉庫中創建了no用戶(它應該是ID爲4xxx的用戶)。 – 2015-04-12 23:30:51