How to authenticate User with interacting with AI agent?

Any suggestions on how to implement a user authentication workflow for the agent? I’m wanting to send the user a unique code ( to an email or phone which they say is their account) which they can input in the chat that I can then use to authenticate. I’m open to other suggestions to do this. Not having variables make this alittle challenging as i’m on the self hosted community plan. Maybe a two agent approach?

Share the output returned by the last node

Information on your n8n setup

  • **n8n version: 1.66.0
  • **Database (default: SQLite): Railyway.app
  • **n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • **Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • **Operating system: MacOS
1 Like

Anyone create something like this?

Hey @A_Bradley , built-in chat authentication allows for only one credentials pair. What you are suggesting sounds reasonable to me. That would imply you keeping track of the credentials in some sort of database and let the user to proceed talking to your AI app if the credentials match against those in the database. You likely want to have an expiration set of each credentials which would also imply deleting or “flagging” those that have expired.

Alternatively, you would use some sort of a proxy in front of your n8n app that would perform the authentication for you before forwarding the query to the app.

PS. It sounds like the user in AI Chat which response based on employee profile already implemented the authentication part or knows how to do it.

i posted the topic AI Chat which response based on employee profile
But yet get any constructive feedback :smiley: still i ain’t sure how n8n chatbot to identify “current user”. I guess we should script in n8n node to get session info? But i dont have the knowledge and an AI template would be much helpful lol

Hi @weilies_chok

Have you tried to use the Authentication option of the Chat?

This will be passed on to the agent and you can base your further logic on it.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.