2017-09-25 69 views

回答

0

你可以得到的最後日期,用戶被認證爲任何應用上User profile

GET https://dev-12345.oktapreview.com/api/v1/users/xyz 

{ 
    "id": "xyz", 
    "status": "ACTIVE", 
    "created": "2017-02-22T02:33:02.000Z", 
    "activated": null, 
    "statusChanged": "2017-02-22T17:50:43.000Z", 
    "lastLogin": "2017-09-28T16:19:57.000Z", 
    "lastUpdated": "2017-08-08T20:11:46.000Z", 
    "passwordChanged": "2017-02-22T17:50:43.000Z", 
    "profile": { 
     "lastName": "Barbettini", 
     "firstName": "Nathanael", 
    // ... 
} 

lastLogin字段包含的用戶最後一次登錄的時間戳記

這雖然沒有在每個應用程序的基礎上進行跟蹤。你可以得到應用特定App User

GET https://dev-12345.oktapreview.com/api/v1/apps/abc/users/ 

{ 
    "created": "2017-09-22T00:54:49.000Z", 
    "lastUpdated": "2017-09-22T00:54:49.000Z", 
    "scope": "GROUP", 
    "status": "ACTIVE", 
    "statusChanged": "2017-09-22T00:54:49.000Z", 
    "passwordChanged": null, 
    "syncState": "DISABLED", 
    "profile": { 
     "zoneinfo": "America/Los_Angeles", 
     "region": null, 
    // ... 
} 

但它沒有lastLogin。解決這個問題的一種方法是在應用程序代碼中的應用程序用戶配置文件中保存一個時間戳。