2017-09-25 73 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。解决这个问题的一种方法是在应用程序代码中的应用程序用户配置文件中保存一个时间戳。