How can I add my own user authentication scheme?

40 views
Skip to first unread message

Alex Frost

unread,
Mar 11, 2024, 5:21:31 AMMar 11
to Tinode General
I made my own user authentication scheme which implements the methods of the AuthHandler interface and change const realName to "test"

Added the following configuration to tinode.conf:
"logical_names": ["basic:test", "test:"],
"test": {
    "server_url": "http://127.0.0.1:9999/",
    "allow_new_accounts": true,
    "use_separate_endpoints": true
},


However, the server does not see my scheme when starting
E2024/03/11 12:01:30 store: unknown handler for logical auth name 'basic:test'

Gene

unread,
Mar 11, 2024, 11:45:17 AMMar 11
to Tinode General
On Monday, March 11, 2024 at 2:21:31 AM UTC-7 Alex Frost wrote:
I made my own user authentication scheme which implements the methods of the AuthHandler interface and change const realName to "test"

Did you create your own authenticator like these
and then imported it like this?
and then you recompiled the server?

Or did you just rename the rest auth to something else?

Alex Frost

unread,
Mar 12, 2024, 4:10:37 AMMar 12
to Tinode General
Did you create your own authenticator like these
https://github.com/tinode/chat/tree/master/server/auth


Yes, I did.Yeah, I think the problem is that I did not import my schema like this

Can I just replace the rest scheme with my own? Will this work?

понедельник, 11 марта 2024 г. в 18:45:17 UTC+3, Gene:
Message has been deleted

Gene

unread,
Mar 12, 2024, 11:14:35 AMMar 12
to Tinode General
On Tuesday, March 12, 2024 at 1:10:37 AM UTC-7 Alex Frost wrote:
Did you create your own authenticator like these
https://github.com/tinode/chat/tree/master/server/auth


Yes, I did.

and then imported it like this?
https://github.com/tinode/chat/blob/99c633297a805123f74642334f87d4a5b8ab7967/server/main.go#L29


Yeah, I think the problem is that I did not import my schema like this

Can I just replace the rest scheme with my own? Will this work?

It will work if you do it correctly.

Alex Frost

unread,
Mar 12, 2024, 4:08:04 PMMar 12
to Tinode General
It will work if you do it correctly.

I managed to do it, thanks for the help!

вторник, 12 марта 2024 г. в 18:14:35 UTC+3, Gene:
Reply all
Reply to author
Forward
0 new messages