Programmatic change of ApiKey
Added by Marco Descher almost 13 years ago
Hy,
is there a way to programmatically change the ApiKey? I want to do this as a security measurement in regular intervals, and automate this!
Thanks for your help!
Replies (2)
RE: Programmatic change of ApiKey
-
Added by Marco Descher almost 13 years ago
I create a small script, where EMAIL denotes the mail address of the account you want to reset the token upon
# myTokenResetScript
user = User.find_by_mail("EMAIL")
t1 = Token.create(:user => user, :action => 'api')
puts(t1.value)
execute the script using
you will get the new token as output of the script and can act upon it accordingly.