blackbox_exporter
blackbox_exporter copied to clipboard
OAuth2 not working?
As per https://github.com/prometheus/blackbox_exporter/pull/784/files#diff-fe44f09c4d5977b5f5eaea29170b6a0748819c9d02271746a20d81a5f3efca17, OAuth2 support was released in 0.19.0. However, I couldn't find any relevant code in the code base. Is it expected to work? If so, it would be great if there is a sample config. Thanks!
Maybe this could help. Add module something like that. We use keycloak as IDP with client settings serviceAccount enabled
http_2xx_oauth:
prober: http
timeout: 5s
http:
valid_http_versions: ["HTTP/1.1", "HTTP/2.0"]
follow_redirects: true
preferred_ip_protocol: "ip4"
valid_status_codes:
- 200
oauth2:
client_id: blackbox
client_secret: mysecret
scopes:
- email
token_url: "https://{{.Values.hostname}}.blub.de/auth/realms/bla/protocol/openid-connect/token"
endpoint_params:
grant_type: client_credentials
Hello blackbox 0.22.0 is perfectly deployed : the probe: http://bbox-exporter.xxx.xxx/probe?target=https://api.xxx.xxx/actuator/health&module=http_aouth_prod is always 0! other probe with other module return 1 OK!
le module with Aouth :
http_aouth_prod:
prober: http
http:
valid_http_versions: ["HTTP/1.1", "HTTP/2"]
preferred_ip_protocol: "ip4"
valid_status_codes:
- 200
follow_redirects: true
oauth2:
client_id: "xyz"
client_secret: "xxxxx"
token_url: "https://xxx/v2/token"
endpoint_params:
grant_type: "client_credentials"
i test the api with postman so it's nickel! is it related to the note in the doc https://github.com/prometheus/blackbox_exporter/blob/master/CONFIGURATION.md ?:
NOTE: This is experimental in the blackbox exporter and might not be reflected properly in the probe metrics at the moment.
need help plz Thank you :)
Hi @roidelapluie When i debug the probe :
level=error msg="Error for HTTP request" err="Get \"https://xx.xx.xx.xx/?q=xyz\": Post \"https://yy.yy.yy.yy/v2/token\": dial tcp yy.yy.yy.yy:443: connect: connection refused"
the config:
http_aouth_prod:
prober: http
http:
preferred_ip_protocol: "ip4"
valid_status_codes:
- 200
- 201
follow_redirects: true
oauth2:
client_id: "xyz"
client_secret: "xxxxx"
token_url: "https://yy.yy.yy.yy/v2/token"
endpoint_params:
grant_type: "client_credentials"
tls_config:
insecure_skip_verify: true
Any idea!? Thank you