Ask Your Question
0

How to get the last token of an user

asked 2014-06-25 09:33:34 -0500

guilhermepimentel gravatar image

Hello! Well, I'd like to know how to get the last token for an user to do a script that controlls the last access of an user to any service on openstack.

is it possible to get such "list" ou individual token without create a new token?

Thanks

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2014-06-25 16:01:14 -0500

updated 2014-06-25 22:39:00 -0500

You can't get last issued token for an user via API. You can get that from DB by doing an sql query. Also it is not necessary that the user is going to access the service using the last issued token

You can't list out indvidual tokens for a user.

Update 1

You can do it with custom code. Add a colum last_logiin in user table and update the column in issue_token call. This is updated on successful login. If the token is valid for X hours, then you need to disable all the users whose last_login + X + 72 hours is less than current time.. You can even add/edit the rest api to return those users that match this criteria

edit flag offensive delete link more

Comments

Thanks! I'll try to do this. As soon as I have news, I'll post here my solution.

guilhermepimentel gravatar imageguilhermepimentel ( 2014-06-27 08:42:11 -0500 )edit
0

answered 2014-06-25 17:06:28 -0500

guilhermepimentel gravatar image

Thanks for your answer, Haneef.

Basically the main ideia behind my question was that I'd like to have guests in my openstack enviorement and if these guests are inactive more than 72 hours, the account must be deleted. I've been thinking a way to identify the last activity of this guest user through the token, that have an expiration, and with this information I could realize when the guest uses the openstack the lastly.

Any suggestions to solve my problem?

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-06-25 09:33:34 -0500

Seen: 80 times

Last updated: Jun 25 '14