Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support new auth in 6.4 #83

Open
fliespl opened this issue Apr 21, 2023 · 3 comments
Open

Support new auth in 6.4 #83

fliespl opened this issue Apr 21, 2023 · 3 comments

Comments

@fliespl
Copy link

fliespl commented Apr 21, 2023

Feature Request

New authorization allows api token.

For all people coming in here needing to utilize it, you can use it as follows (setAuthToken won't work).

$options = [
            \GuzzleHttp\RequestOptions::HEADERS => [
                'Authorization' => 'Bearer ' . $_ENV['ZABBIX_TOKEN']
            ]
        ];
        $this->zabbixApi = new ZabbixApi('https://' . $_ENV['ZABBIX_DOMAIN'] . '/api_jsonrpc.php', null, null, null, null, null, null, $options);
@plfiumi
Copy link

plfiumi commented May 24, 2023

Hi, this is not working for me, I'm getting a "Not authorized." response.
I've generated a token for super admin user, should be access to everything. Any idea? :)

@fliespl
Copy link
Author

fliespl commented May 25, 2023

@plfiumi can you share example of code you are using? Maybe you set username / password as well? In my case.

We are using this piece for a few weeks now without issues.

@plfiumi
Copy link

plfiumi commented Jun 5, 2023

Finally, I'm using this library: https://github.com/intellitrend/zabbixapi-php

Thanks for your help :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants