authenticate
Creates a route that allows you to define authorization scope for application resources. This function accepts names of authentication providers defined in the Authentication plugin configuration.
Parameters
names of authentication providers defined in the Authentication plugin configuration.
when set, if the client provides no authentication, a call continues but with a null authenticated value.
See also
Throws
if no Authentication plugin installed first.
if there are no registered providers referred by configurations names.
Creates a route that allows you to define authorization scope for application resources. This function accepts names of authentication providers defined in the Authentication plugin configuration.
When combined with other route-scoped guard plugins such as io.ktor.server.plugins.ratelimit.rateLimit, the relative execution order follows route nesting: interceptors on parent routes run before interceptors on child routes. To use a principal in a rate limit io.ktor.server.plugins.ratelimit.RateLimitProviderConfig.requestKey, nest rateLimit inside authenticate.
Parameters
names of authentication providers defined in the Authentication plugin configuration.
defines resolution strategy for nested authentication providers. AuthenticationStrategy.Optional - if the client provides no authentication, a call continues but with a null authenticated value. AuthenticationStrategy.FirstSuccessful - client must provide authentication data for at least one provider registered for this route AuthenticationStrategy.Required - client must provide authentication data for all providers registered for this route with this strategy
See also
Throws
if no Authentication plugin installed first.
if there are no registered providers referred by configurations names.