kernel/private/rest/classes/auth/styles/oauth.php
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;
    }
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;
    }
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 ; }
Method extracted from MvcAuthenticationTiein

Checks the status from the authentication run and adds the reasons as
variable to the $result.

This method uses the information that is set by the
runAuthRequiredFilter() filter to generate an user-readable text of the
found $reasons and sets these as the variable ezcAuth_reasons in
the $result. You can supply your own mapping from status codes to
messages, but a default is provided. Please refer to the Authentication
tutorial for information about status codes.

@param ezcMvcResult $result
@param array(string) $reasons
@param array(string=>array(int=>string) $errorMap
Method extracted from MvcAuthenticationTiein