AndroidDev 板


LINE

→ ginnyhuang:使用第三方平台登入,我是在user登入後取得該account的 05/13 15:36 → ginnyhuang:ID,使用這個ID當作user的帳號存入server的database, 05/13 15:37 → ginnyhuang:之後在app中user和server的溝通就以此帳號為憑依(也可 05/13 15:37 → ginnyhuang:以自行加入其他識別字串) 05/13 15:37 → ginnyhuang:因為我只有用到讓user可以快速登入,沒有需要使用社群 05/13 15:37 → ginnyhuang:互動,所以只是讓第三方平台幫你識別這個人是誰,不需 05/13 15:37 → ginnyhuang:要記錄token什麼的 05/13 15:38 → ginnyhuang:我記得和第三方的auth token也是有時效性的,不確定是 05/13 15:38 → ginnyhuang:每次重新登入他會更新還是多久更新一次 05/13 15:38 → ginnyhuang:auth token應該是給第三方程式登入但又不想讓該程式知 05/13 15:38 → ginnyhuang:道帳密而使用的流程?app和server是否也可以(需要)用, 05/13 15:40 → ginnyhuang:這我還真不太清楚XD(這部分沒研究,我是直接加密) 05/13 15:40 → ginnyhuang:看新聞FB似乎要推出個匿名登入...不知道新版情況如何, 05/13 15:40 → ginnyhuang:坐等api釋出囉@@ 希望以上資訊有幫到你~也許其他人有更 05/13 15:40 → ginnyhuang:更安全的做法? 05/13 15:41 → ginnyhuang:剛查到有關實作OAuth2"服務"的系列文,還不錯: 05/13 15:41 → ginnyhuang:http://ppt.cc/vO3Q 05/13 15:42 → ginnyhuang:或google: OAuth 2.0 筆記 05/13 15:44 感謝ginny大的回覆。 從推文了解,ginny 大是把 "login with google" 當作一個幫user省去打email & password的sign up的工具 想請問我這個從推文中理解的這個流程,是不是正確標準流程? login with google -> get username(gmail) -> register to AccountManager -> register username in OUR server -> server grants token -> use the token fetch protected data in our server 舉例來說: 1. emma 在我們的app 使用 login with google 2. app 獲得 emma 的 username ([email protected]) & google token 根據scope不同,app可以用這個google token 跟 google 要其他資料 (不重要) 3. app 把 [email protected] register 在 app 的 AccountManager 4. app 把這個account register在"我們的"server database 同時,"我們的" server 也 return 一個token' 5. 之後所有 app 對"我們的"server 要 protect 資料時,都要使用token' 如果這是標準流程,我有問題, 在步驟4,傳統登入流程,credential會帶 username + password 可是這個OAth是沒有帶password,這樣"我們的"server該如何認證這是emma? google document看很多次了,可是都只有說到該如何用google token要google資料 或是該怎麼把one-time authorization code pass給server 讓server可以跟google要資料 都沒有解釋到我的問題 請板上大大幫忙了 --



※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 76.195.58.29
※ 文章網址: http://webptt.com/m.aspx?n=bbs/AndroidDev/M.1417573938.A.6CB.html
1F:推 freesamael: 用 google access token 當作 credentials, 12/04 02:49
2F:→ freesamael: scopes 只要有 "profile" 就可以了 12/04 02:49
3F:→ freesamael: https://developers.google.com/+/api/oauth#profile 12/04 02:49
4F:→ freesamael: server 端拿手機傳上來的 token 去 get profile 12/04 02:50
5F:→ freesamael: 由 return 的 uid 驗證是否為 "emma" 12/04 02:50
6F:→ freesamael: http://tinyurl.com/pfo848z 12/04 02:50
7F:→ freesamael: 剩下就兩個 error handling 要處理 12/04 02:51
8F:→ freesamael: 1. 如果手機傳給 server 的 token 已經過期 12/04 02:51
9F:→ freesamael: 應以適當 error code 讓 app 重新取得 google token 12/04 02:51
10F:→ freesamael: 2. 如果手機上的 google account 登出之後 12/04 02:51
11F:→ freesamael: 看是你的 app 要同時登出還是怎樣 handle 12/04 02:52







like.gif 您可能會有興趣的文章
icon.png[問題/行為] 貓晚上進房間會不會有憋尿問題
icon.pngRe: [閒聊] 選了錯誤的女孩成為魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一張
icon.png[心得] EMS高領長版毛衣.墨小樓MC1002
icon.png[分享] 丹龍隔熱紙GE55+33+22
icon.png[問題] 清洗洗衣機
icon.png[尋物] 窗台下的空間
icon.png[閒聊] 双極の女神1 木魔爵
icon.png[售車] 新竹 1997 march 1297cc 白色 四門
icon.png[討論] 能從照片感受到攝影者心情嗎
icon.png[狂賀] 賀賀賀賀 賀!島村卯月!總選舉NO.1
icon.png[難過] 羨慕白皮膚的女生
icon.png閱讀文章
icon.png[黑特]
icon.png[問題] SBK S1安裝於安全帽位置
icon.png[分享] 舊woo100絕版開箱!!
icon.pngRe: [無言] 關於小包衛生紙
icon.png[開箱] E5-2683V3 RX480Strix 快睿C1 簡單測試
icon.png[心得] 蒼の海賊龍 地獄 執行者16PT
icon.png[售車] 1999年Virage iO 1.8EXi
icon.png[心得] 挑戰33 LV10 獅子座pt solo
icon.png[閒聊] 手把手教你不被桶之新手主購教學
icon.png[分享] Civic Type R 量產版官方照無預警流出
icon.png[售車] Golf 4 2.0 銀色 自排
icon.png[出售] Graco提籃汽座(有底座)2000元誠可議
icon.png[問題] 請問補牙材質掉了還能再補嗎?(台中半年內
icon.png[問題] 44th 單曲 生寫竟然都給重複的啊啊!
icon.png[心得] 華南紅卡/icash 核卡
icon.png[問題] 拔牙矯正這樣正常嗎
icon.png[贈送] 老莫高業 初業 102年版
icon.png[情報] 三大行動支付 本季掀戰火
icon.png[寶寶] 博客來Amos水蠟筆5/1特價五折
icon.pngRe: [心得] 新鮮人一些面試分享
icon.png[心得] 蒼の海賊龍 地獄 麒麟25PT
icon.pngRe: [閒聊] (君の名は。雷慎入) 君名二創漫畫翻譯
icon.pngRe: [閒聊] OGN中場影片:失蹤人口局 (英文字幕)
icon.png[問題] 台灣大哥大4G訊號差
icon.png[出售] [全國]全新千尋侘草LED燈, 水草

請輸入看板名稱,例如:Tech_Job站內搜尋

TOP