Behavior: MynaAuth

Applies action.controller based authentication and rights checking to controllers.

This behavior uses Myna’s centralized authentication and permissions system to authenticate this controller’s actions.  Each action is treated as a right in the form of “<controllerName>.<actionName>”.  If the current user is not authenticated, they are sent to Myna’s centralized login page and authenticated against one of the defined AuthTypes (see: AuthAdapters)


whitelistOptional, default [] Array of action names that do not require authentication
anyUserListOptional, default [] Array of action names that do not require a specific right, but do require an authenticated user
providersOptional, default <Myna.Permissions.getAuthTypes> Array of provider names (AuthTypes) to make available from authentication,
redirectParamsOptional, default {} Any extra parameters to $res.redirectLogin.  This behavior will automatically set the callbackUrl to the originally requested action
userFunctionOptional, default $cookie.getAuthUser Function to call to acquire the user to test against permissions.  This function will be passed a reference to the controller, and this options object


This behavior only protects the controllers to which it is applied.  If this is not set in the global controller your application may be at risk for unauthorized access


// used in the global controller
function init(){
return controller._getUser()

// used in a single controller
function init(){
providers:Myna.Permissions.getAuthTypes(),//this is default
redirectParams:{}//this is default
Auth Adapters are customizable authentication modules that can be used with Myna’s permissions system or separately.
Redirect this page to the central login page