You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: authentication/oauth.mdx
+14
Original file line number
Diff line number
Diff line change
@@ -147,6 +147,20 @@ You need to set the following environment variables:
147
147
-`OAUTH_KEYCLOAK_BASE_URL`: Your Keycloak URL.
148
148
-`OAUTH_KEYCLOAK_NAME`: Optional, see above.
149
149
150
+
### Custom Provider
151
+
It's possible to plug-in for any OAuth provider using Chainlit. Required steps are:
152
+
- modifying `providers` variable in runtime
153
+
- implementing `CustomOAuthProvider(OAuthProvider)` class with methods and fields:
154
+
-`get_token(self, code, url)`
155
+
-`get_user_info(self, token)`
156
+
-`authorize_params`
157
+
-`env`
158
+
- providing environmental variables as described in `env`, for example:
159
+
-`YOUR_PROVIDER_CLIENT_ID`
160
+
-`YOUR_PROVIDER_CLIENT_SECRET`
161
+
162
+
[This cookbook example](https://github.com/Chainlit/cookbook/tree/main/auth) describes how to do it, also check [base class](https://github.com/Chainlit/chainlit/blob/2cb38ad8596ac547355f87266bc15ab3dfd632d2/backend/chainlit/oauth_providers.py#L13) for reference.
163
+
150
164
## Prompt Configuration
151
165
152
166
Starting from version 1.3.0, Chainlit allows you to configure how OAuth providers handle re-authentication through the `prompt` parameter. This is particularly useful for controlling the login behavior when users log out.
0 commit comments