Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use Chatbot in private #212

Open
kientv opened this issue Jul 27, 2024 · 4 comments
Open

How to use Chatbot in private #212

kientv opened this issue Jul 27, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@kientv
Copy link

kientv commented Jul 27, 2024

Could we restrict chat user by personal token (API key) or username, password .
Do not want to public bot in the internet

@HenryHengZJ
Copy link
Contributor

hmm not possible for now, something we plan on roadmap

@HenryHengZJ HenryHengZJ added the enhancement New feature or request label Aug 6, 2024
@CasperJ
Copy link

CasperJ commented Aug 20, 2024

Hi,
I've a similar request here #227 and I've made PR #226 which introduces this kind of functionality.
I our case we a portal that users log into and then they see the bot. The portal is protected by an OAuth flow. With our addition we can now push down that JTW token to the API by injecting it into the http request before it got sent.

sequenceDiagram
    participant User
    participant API Gateway
    participant Identity Server
    participant FlowiseAI API
    User->>Identity Server: OAuth dance to get JWT token
    Identity Server-->>User: Get JWT Token and store in Browser
    User->>API Gateway: GET /api/ai/* (JWT injected in header)
    Note right of API Gateway: API Gateway validates JWT
    API Gateway-->>FlowiseAI API: Forward request unauthenticated
    FlowiseAI API-->>API Gateway: Response
    API Gateway-->>User: Response

Loading

@kientv
Copy link
Author

kientv commented Aug 20, 2024

What's oauth2 grant type do you use in myIdentityApi.getCredencial()

@CasperJ
Copy link

CasperJ commented Aug 20, 2024

In our case we have integrated it within our Backstage portal. Backstage provides a way to get the JWT token clientside. Other sites might store it in local storage. It really depends on the framework you are using.

In Backstage the auth flow is consent and refresh flow: https://backstage.io/docs/auth/oauth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants