Page 1 of 1
API Key updated, now no longer working
Posted: Wed Oct 05, 2016 12:52 pm
by GldRush98
So I inadvertently updated my API key on my profile and now API authorization is no longer working. I just get a "Your session has timed out" error.
It was used to auto log in to opscreen. It basically called a url of the format
opscreen.php?username=myuser&ticket=apikey
Re: API Key updated, now no longer working
Posted: Wed Oct 05, 2016 1:09 pm
by jomann
If you're running 5.3.0 then the API key is actually different then your backend ticket! Which means that you won't be able to use your API key to log in via the username/ticket variables like before. The ticket does still exist, it just isn't the same as your API key anymore
You can get the ticket by either looking in the DB, the rapid response URL, or checking the URLs in Admin > Manage Components > Backend API > select user you want ticket for.
Re: API Key updated, now no longer working
Posted: Wed Oct 05, 2016 1:14 pm
by GldRush98
Yes, that explains it! I should have left the URL alone and it wouldn't have broke
Running a psql query:
Code: Select all
nagiosxi=> select * from xi_users where username='myusername';
Reveals the error of my ways. The ticket is now different from the api_key. I guess they used to be the same but are now different.
and
Admin > Manage Components > Backend API > select user you want ticket for.
Is useful
Thanks. I'll stop monkeying with things now

Re: API Key updated, now no longer working
Posted: Wed Oct 05, 2016 1:50 pm
by jomann
Awesome, so it's working now? Can we help you with anything else or is it okay to close this?

Re: API Key updated, now no longer working
Posted: Wed Oct 05, 2016 3:17 pm
by GldRush98
Oh yeah, working good. Close away.

Re: API Key updated, now no longer working
Posted: Wed Oct 05, 2016 3:25 pm
by avandemore
Great, if you have further problems please open a new thread.