Does the X-Auth-Token expires?

Asked by Nick Fytros on 2014-01-09

Hi,
I used: curl -v -H 'X-Storage-User: test:tester' -H 'X-Storage-Pass: testing' http://127.0.0.1:8080/auth/v1.0
and i got an answer with the X-Auth-Token and X-Storage-Url .
I can create meta and containers etc.
When i tried to list my account metadata after 2 days with the command:
 curl -v -H 'X-Storage-User: iot:ioter' -H 'X-Storage-Pass: iot' http://127.0.0.1:8080/auth/v1.0
i responded with 401 unauthorized. My X-Auth-Token from above was not valid anymore and i had to run:
 curl -v -H 'X-Storage-User: test:tester' -H 'X-Storage-Pass: testing' http://127.0.0.1:8080/auth/v1.0 again to get a new one.
Is this normal?
Also i cannot create any other account with: curl -v -H 'X-Storage-User: test1:tester1' -H 'X-Storage-Pass: testing1' http://127.0.0.1:8080/auth/v1.0 .
Only the test:tester with pass testing. Everything else i put returns 401 unauthorized.

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Object Storage (swift) Edit question
Assignee:
No assignee Edit question
Solved by:
NMarcos
Solved:
2014-01-14
Last query:
2014-01-14
Last reply:
2014-01-14
Samuel Merritt (torgomatic) said : #1

Token expiration depends on the auth system. It looks like you're using tempauth here, and tempauth tokens expire after 1 day (by default; it's configurable).

Nick Fytros (fitros16) said : #2

Ok, got it. Will read more for tempauth then but can you tell me where can i configure that? At the proxy-server.conf?
Thanks,
Nikos

Best NMarcos (nelsonmarcos) said : #3

Hi Nick!

Reading the tempauth.py file I found this line:
        self.token_life = int(conf.get('token_life', 86400))

The second parametrs looks like
86400 / 3600 = 24 hours

I'm almost sure you just have to change this value.

Nick Fytros (fitros16) said : #4

Thank you very much. It worked!