authenticate
Creates an authentication route that does handle authentication by the specified providers referred by configurations names. null
could be used to point to the default provider and could be also mixed with other provider names. Other routes, handlers and interceptors could be nested into this node
The Authentication feature need to be installed first otherwise it will fail with MissingApplicationFeatureException and all providers requested by configurations need to be already registered.
Is is important to note that when optional is set, challenges will be skipped only if no credentials are provided.
To summarize:
optional=false:
No credentials: challenge is sent and route is NOT executed
Bad credentials: Unauthorized
Good credentials: route handler will be executed
optional=true:
No credentials: route handler will be executed with a null Principal
Bad credentials: Unauthorized
Good credentials: route handler will be executed
Parameters
names that point to already registered authentication providers
when set, if no auth is provided by the client, the call will continue but with a null Principal
Throws
if no Authentication feature installed first
if there are no registered providers referred by configurations names