function processLoginRequired( ezcMvcResult $res, $reasons, $errorMap = null )
    {
        $reasonText = array();

        if ( $errorMap === null )
        {
            $errorMap = array(
                'ezpOauthFilter' => array(
                    ezpOauthFilter::STATUS_TOKEN_INVALID            => 'Token has expired.',
                    ezpOauthFilter::STATUS_TOKEN_EXPIRED            => 'Token has expired, please refresh it.',
                    ezpOauthFilter::STATUS_TOKEN_INSUFFICIENT_SCOPE => 'You do have do have sufficient scope to access this resource.',
                ),
            );
        }

        foreach ( $reasons as $line )
        {
            $reasonText[] = $errorMap[key( $line )][current( $line )];
        }
        $res->variables['ezcAuth_reasons']  = $reasonText;
    }