I am writing a CMS in Kotlin that uses DSLs to pro...
# ktor
w
I am writing a CMS in Kotlin that uses DSLs to produce pages (Kotlinx). I need to add authentication for the administrative side of things and to create custom content for each user. Any ideas of a good fit for Ktor?
t
d
Will it be a decoupled, headless CMS?
w
I have looked at the Ktor authentication. I don't think it matches my needs as it's route based. I wanted a session based authentication with a token to manage access control...
@Dennis Schröder the pages and posts are held in a SQL database. The front end is written in react. The code is here: https://github.com/wilyarti/cms
I am a not a professional programmer.
c
@wilyarti Could you please explain what do you mean by "token to manage access control" ?
Session based auth is done by
SessionAuthenticationProvider
This is to configure auth by sessions
but you also need to configure sessions https://ktor.io/servers/features/sessions.html
w
Thanks @cy that will work perfectly. Instead of a token I will just use this feature.
It's a shame that we don't have it in our docs
w
Cheers I will check it out :)
For anyone following. I used server based sessions with authentication to solve this. The source code is here(I found it hard to get a complete example): https://github.com/wilyarti/cms
I stole the authentication boiler plate from a forum... Still need to credit it in my source code