Open cedkoffeto opened 1 week ago
@dosu What would you suggest as answers for my aforementioned questions?
Hey @dokterbob! I'm here to help you with any issues or questions you have. I'm a bot designed to assist you with bug fixes, answer questions, and guide you in becoming a contributor. Let me know how I can assist you!
To support Keycloak authentication in Chainlit, here are the answers to the questions:
Why should Chainlit support Keycloak? Keycloak is a widely used open-source identity and access management solution. Supporting Keycloak would allow organizations that already use Keycloak for authentication to seamlessly integrate Chainlit into their existing infrastructure. This would enhance security, simplify user management, and provide a consistent authentication experience across different applications. More information about Keycloak can be found here.
What steps might be required? To support Keycloak authentication in Chainlit, the following steps would be required:
chainlit.oauth_providers
module to include a Keycloak provider. This would involve creating a new class for Keycloak that handles the OAuth flow, including token exchange and user information retrieval.authenticate_user
function to handle tokens issued by Keycloak. This may involve verifying the token with Keycloak and extracting user information.Here is a simplified example of how you might start implementing the Keycloak provider:
# chainlit/oauth_providers/keycloak.py
import requests
from fastapi import HTTPException
class KeycloakOAuthProvider:
def __init__(self, client_id, client_secret, server_url):
self.client_id = client_id
self.client_secret = client_secret
self.server_url = server_url
def get_token(self, code):
response = requests.post(
f"{self.server_url}/protocol/openid-connect/token",
data={
"client_id": self.client_id,
"client_secret": self.client_secret,
"grant_type": "authorization_code",
"code": code,
},
)
if response.status_code != 200:
raise HTTPException(status_code=401, detail="Invalid Keycloak token")
return response.json()
def get_user_info(self, token):
response = requests.get(
f"{self.server_url}/protocol/openid-connect/userinfo",
headers={"Authorization": f"Bearer {token}"},
)
if response.status_code != 200:
raise HTTPException(status_code=401, detail="Failed to fetch user info")
return response.json()
Contribution or Payment
This approach ensures that the integration is well-planned and aligns with the project's goals and community standards [1][2].
To continue talking to Dosu, mention @dosu.
@cedkoffeto Appreciate your feedback but the phrasing comes across a bit demanding, particularly considering that this is an Open Source project.
@dokterbob Not everyone speaks English as their native language and different cultures communicate in different ways, so sometimes community writing might not appeal to your delicate sensibilities. Also, not everyone has deep experience interacting with github projects, so perhaps you should stop whining and complaining day after day and scolding the people of this community, and show a bit more tolerance. There are higher priorities here than how you feel and how easy the community makes your life, no? There is more than one way to understand mindfulness.
This is particularly important given that the software you have promised "Build production-ready Conversational AI applications in minutes, not weeks" doesn't exist. In other words, you are not in a position to make daily selfish demands of this community. You are liars.
So again, perhaps you should keep your evidently hard-to-control emotions to yourself and just do your job :)
Most importantly, this is not an Open Source Project. It is a well-funded company fraudulently pretending that it is so that they can get free labor. (https://literalai.notion.site/Literal-AI-Chainlit-Careers-cec94330409c405993407f92ca5e99da)
Where are these people anyway? I haven't seen any commits from your engineers and your Developer Advocate hasn't made an appearance: https://literalai.com/team
It's important that we all remain mindful of the truth.
@cedkoffeto Appreciate your feedback but the phrasing comes across a bit demanding, particularly considering that this is an Open Source project.
Please in the future try and be more mindful and tell us:
Thanks!