Basic authentication with the post method

Report a typo

Consider the Form authorization we implemented in the topic. What happens if we put Basic authentication instead of Form authentication? (This leaves the authentication name ("myFormAuth") and the rest of the code unchanged.)

install(Authentication) {
    basic("myFormAuth") {
        realm = "Access to the '/page' path"
        validate { credentials ->
            if (credentials.name == "Admin" && credentials.password == "2425") {
                UserIdPrincipal(credentials.name)
            } else {
                null
            }
        }
    }
}

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