Login history for logged in user

I see a number of posts where an admin can retrieve login history for its users utilizing the System Log API. Is it possible to to execute a similar api call by the logged in user themself? Assumingly using the access token they’re granted at login… In our user profile section, it would be nice to be able to allow a user to view their own login history.

@jchabot86 Hi, Please refer the system log API here

Thanks yes I have read that. But can that be used by the user’s access token? If so, where does it go in the request header? I always get 401s when trying to use the access token on the system log api. These users are NON ADMIN level users. They are users of our application which is integrated with Okta for their authentication.

Hello,
It is possible to use access tokens for Okta APIs (system log), but the access token must have been minted by the Orgs authorization server. A customer authorization server, including ‘default’, can’t be used. The application also needs to grant the correct scopes, ‘okta.logs.read’ in this case. The user will need to request this scope when logging in.

Please check out the OAuth for Okta documentation for details.

1 Like