Open Alex-Dee opened 4 months ago
Hi, I'm experiencing the same issue. I'm using streamlit-keycloak version 1.1.1 and encountering the same problem. Clearing the cookies in both the Streamlit app and Keycloak didn't resolve it.
@Alex-Dee this worked for me:
login(
url=settings.keycloak_url,
realm=settings.keycloak_realm,
client_id=settings.keycloak_client_id,
init_options={"checkLoginIframe": True},
auto_refresh=True,
custom_labels={
"labelButton": "Sign in",
"labelLogin": "Please sign in to your account.",
"errorNoPopup": "Unable to open the authentication popup. Allow popups and refresh the page to proceed.",
"errorPopupClosed": "Authentication popup was closed manually.",
"errorFatal": "Unable to connect to Keycloak using the current configuration.",
},
)
Plus, I had to adjust KeyCloak realm configuration in Realm settings
- Security defences
- Content-Security-Policy
- frame-src 'self'; frame-ancestors 'self' <your URL here>; object-src 'none';
@Alex-Dee this worked for me:
login( url=settings.keycloak_url, realm=settings.keycloak_realm, client_id=settings.keycloak_client_id, init_options={"checkLoginIframe": True}, auto_refresh=True, custom_labels={ "labelButton": "Sign in", "labelLogin": "Please sign in to your account.", "errorNoPopup": "Unable to open the authentication popup. Allow popups and refresh the page to proceed.", "errorPopupClosed": "Authentication popup was closed manually.", "errorFatal": "Unable to connect to Keycloak using the current configuration.", }, )
Plus, I had to adjust KeyCloak realm configuration in
Realm settings
-Security defences
-Content-Security-Policy
-frame-src 'self'; frame-ancestors 'self' <your URL here>; object-src 'none';
what's your keycloak version?
@Alex-Dee this worked for me:
login( url=settings.keycloak_url, realm=settings.keycloak_realm, client_id=settings.keycloak_client_id, init_options={"checkLoginIframe": True}, auto_refresh=True, custom_labels={ "labelButton": "Sign in", "labelLogin": "Please sign in to your account.", "errorNoPopup": "Unable to open the authentication popup. Allow popups and refresh the page to proceed.", "errorPopupClosed": "Authentication popup was closed manually.", "errorFatal": "Unable to connect to Keycloak using the current configuration.", }, )
Plus, I had to adjust KeyCloak realm configuration in
Realm settings
-Security defences
-Content-Security-Policy
-frame-src 'self'; frame-ancestors 'self' <your URL here>; object-src 'none';
what's your keycloak version?
streamlit
: 1.36.0
streamlit-keycloak
: 1.1.1
@Alex-Dee this worked for me:
login( url=settings.keycloak_url, realm=settings.keycloak_realm, client_id=settings.keycloak_client_id, init_options={"checkLoginIframe": True}, auto_refresh=True, custom_labels={ "labelButton": "Sign in", "labelLogin": "Please sign in to your account.", "errorNoPopup": "Unable to open the authentication popup. Allow popups and refresh the page to proceed.", "errorPopupClosed": "Authentication popup was closed manually.", "errorFatal": "Unable to connect to Keycloak using the current configuration.", }, )
Plus, I had to adjust KeyCloak realm configuration in
Realm settings
-Security defences
-Content-Security-Policy
-frame-src 'self'; frame-ancestors 'self' <your URL here>; object-src 'none';
what's your keycloak version?
* `streamlit`: `1.36.0` * `streamlit-keycloak`: `1.1.1`
Having the same issue and the dependencies and configuration sadly did not work for me.
@JaworIwanowRoosi could be the KeyCloak settings? Have you opened your browser DevTools for any errors?
@JaworIwanowRoosi could be the KeyCloak settings? Have you opened your browser DevTools for any errors?
Thank you very much vor the quick reply! I'm somewhat confident, that the config is correct, as I've followed the guides/readmes and trying to mess with the settings results in "Timeout when waiting for 3rd party check iframe message." errors.
The devtools do catch an error;
GET [http://localhost:8080/realms/local/protocol/openid-connect/login-status-iframe.html/init?client_id=localclient&origin=http://localhost:8085]
(http://localhost:8080/realms/local/protocol/openid-connect/login-status-iframe.html/init?client_id=localclient&origin=http%3A%2F%2Flocalhost%3A8085)
[HTTP/1.1 403 Forbidden 12ms]
Uncaught (in promise) TypeError: t[18] is undefined
http://localhost:8085 is added to the content-security-policy.
It looks good to me, I am unsure what may the problem at this moment.
Got it to work by setting the valid redirect uris and weborigins both to accept everything through the * wildcard. No variation of localhost settings seemed to work, though I'm running WSL and I've had issues with localhost/host.docker.internal before.
Hi, thanks for the great component. I'm trying to get it running but have the problem that the sign in button /widget is not showing upon when calling login(). Also no erros message is shown, the page just stays blank. Im using the example code from the repo, only with changes to realm and client names. I am using streamlit version 1.35. Hope you can help me with this issue.
Cheers