Keycloak - how to set timeout for http client used in keycloak library - httpclient

I am using keycloak-adapter-core in version 9.0.2 and need to set a timeout for a HTTP connection between application and Keycloak server. Unfortunately, I do not see this option in the library:
https://www.keycloak.org/docs/latest/securing_apps/#_java_adapter_config
e.g. connection-pool-size.
I recheck also code library and I do not see that timeout is set up.
Do you know any workaround for this ?

You need to use
socket-timeout-millis
in your config. See here for reference

Related

Keycloak fastapi integation

I am trying to build an app, with fastapi. I was trying to use keycloak for authentication part,
from fastapi_keycloak import FastAPIKeycloak, OIDCUser
app = FastAPI()
idp = FastAPIKeycloak(
server_url="https://auth.some-domain.com/auth",
client_id="some-client",
client_secret="some-client-secret",
admin_client_secret="admin-cli-secret",
realm="some-realm-name",
callback_uri="http://localhost:8081/callback"
)
idp.add_swagger_config(app)
I am using version 20.0 and someone recommended to not use http:// when providing server url.
I followed this process for integration https://fastapi-keycloak.code-specialist.com/#apppy as per this documentation. Now when I am giving my server url starting with http:// it shows throws an error, i.e. MissingSchema: Invalid URL 'None': No scheme supplied. Perhaps you meant http://None? and without http://
InvalidSchema(f"No connection adapters were found for {url!r}")
requests.exceptions.InvalidSchema: No connection adapters were found for this is the result.
Can someone please look into this and help me out.
Thank you InvalidSchema(f"No connection adapters were found for {url!r}")
requests.exceptions.InvalidSchema: No connection adapters were found for
FastAPi not support v20.0, it supports v16.1.x(latest version v16.1.1)
So you can't using with v20.0
I tested this docker compose and app.py
This is access roles API to FastAPI
http://localhost:8081/roles

Mulesoft - Uh-oh spaghettios! There's nothing here

This error is driving me nuts...
Situation:
I am trying to create a REST api and use a api-gateway proxy to access it. Proxy URL is HTTPS.
The deployment goes through fine. No errors reported in the logs. Worker assigned.
However when I try to access through browser get the "Uh-oh spaghettios! There's nothing here.".
Have tried all the usual things like making the https port dynamic using ${https.port} and using 0.0.0.0 instead of localhost in the http-listener config. But that does not help. Has this something to got to do with the proxy version ?
Any help or pointers will be great!
Make sure you follow Steps 2 from below link
Getting Started with Connectors
All,
Got the resolution. The problem was with the certificate chain. The keystore did not contain intermediate certificates. When added to the keystore the connectivity worked fine.
Only if Mulesoft provided correct errors or detailed logging, I would have saved lot of time over this.
Thanks for your inputs.

How to configure Mongodb MMS to go via a Proxy?

How to I change the monitoring-agent.config to go out via proxy with authentication?
The change log states...
Monitoring Agent 2.3.1.89-1
Released 2014-07-08
Added support for HTTP proxy configuration in the agent configuration file.
But I can't see how to do this.
Following wdberkeley's link I can add this value to the monitoring-agent.config file.
httpProxy=http://"pxproxy01":3128
But this gives..
Failure getting conf. Op: Get Err: Proxy Authentication Required
Is there anyway to set the authentication user/password ?
Edit file:
C:\MMSData\Monitoring\monitoring-agent.config
Add line...
httpProxy=http://<insert_server_address>:<insert_port>
e.g.
httpProxy=http://PROXY01.server.com:3128
Then get the proxy control team, who ever they be, to exclude the following from requiring authentication.
https://mms.mongodb.com 80
https://mms.mongodb.com 443
This has worked for me. I now have the MMS Agent on Windows sending stat's to the MMS service.
Thanks to #wdberkeley for starting me off on this route.
wdberkeley, the page you linked to does not exist & the classic page PDF & HTTP versions state 'HTTP_PROXY' not 'httpproxy' (on OSx section & tar.gz section), section '6.6 Monitoring Agent Configuration' does state the correct property name 'httpproxy'.

Jasper server datasource timeout setting

I'm using JasperReports Server 4.7 with PostgreSQL 9.1 backend. Trying to set the data source timeout setting but cannot find it in the datasource configuration page. Anyone know where I can set this? I've also searched all the configuration xml files as well.
I don't think you can do it with a JDBC data source (though I'm not certain). But you can certainly set a timeout or a keepalive parameter on a JNDI datasource. Use that instead, and you should be all set.
You can indeed specify a connection timeout in the jdbc url.
example: jdbc://server/database?connectTimeout=<TIMEOUT IN MILLISECONDS>
Check more properties here: http://dev.mysql.com/doc/connector-j/en/connector-j-reference-configuration-properties.html

Stop framework from using HTTP Proxy

After nearly drowning in tears of frustration I have to ask you a question.
My play (2.0.3, scala) application is consuming a wsdl, which works perfectly fine, if I run the dev version of my webservice on localhost, which makes the wsdl-url something like http://localhost:8080/Service/Service?wsdl.
When I try to consume the WSDl from the remote test system server, with an Url like http://testserver.company.net:8084/Service/Service?wsdl, I get:
[WebServiceException: Failed to access the WSDL at: http://testserver.company.net:8084/Service/Service?wsdl. It failed with: Got Server returned HTTP response code: 502 for URL: http://testserver.company.net:8084/Service/Service?wsdl while opening stream from http://testserver.company.net:8084/Service/Service?wsdl.]
My company uses a http proxy for internet use, which is the reason for the 502 error. So I want play to stop using the proxy.
So far I have tried (all together):
deleted proxy from Intenet Explorer
set _JAVA_OPTIONS=-Dhttp.noProxyHosts="testserver.company.net"
set JAVA_OPTIONS=-Dhttp.noProxyHosts="testserver.company.net"
play run -Dhttp.noProxyHosts="testserver.company.net"
None of this worked. Any ideas? How can I stop play from using the HttpProxy?
EDIT:
I found it has someting to do with java Webservices-api / jaxws libraries.
Any ideas?
EDIT 2012-10-17:
It seams to depend on system proxy settings. I still don't know why it didn't work that day although I deleted the whole proxy from IE and restarted everything. Is there any way to make my play app independend from system settings?
Try:
play -Dhttp.noProxyHosts="testserver.company.net" run
I noticed a typo in your property, the correct property is http.nonProxyHosts so add and extra n after no.