Form authorization

Report a typo

Consider the Form authorization we implemented in the topic. When we set up the Form authentication, we specified a redirect to the form page in the challenge method. What happens if we leave it blank?

install(Authentication) {
    form("myFormAuth") {
        userParamName = "username"
        passwordParamName = "password"
        validate { credentials ->
            if (credentials.name == "Admin" && credentials.password == "2425") {
                UserIdPrincipal(credentials.name)
            } else {
                null
            }
        }
        challenge {
             //call.respondRedirect("/auth")
        }
    }
}

Open the IDE and check the result yourself.

Select one or more options from the list
___

Create a free account to access the full topic