src/ResponseType/AbstractResponseTypeHandler.php
protected function checkUsername()
    {
        $token = $this->tokenStorage->getToken();
        if (!$token instanceof RememberMeToken && !$token instanceof UsernamePasswordToken) {
            throw new ServerErrorException([
                'error_description' => 'The authorization server encountered an unexpected condition that prevented it from fulfilling the request.',
            ]);
        }

        return $token->getUsername();
    }
protected function checkUsername()
    {
        $token = $this->tokenStorage->getToken();
        if (!$token instanceof RememberMeToken && !$token instanceof UsernamePasswordToken) {
            throw new ServerErrorException([
                'error_description' => 'The authorization server encountered an unexpected condition that prevented it from fulfilling the request.',
            ]);
        }

        return $token->getUsername();
    }
protected function checkUsername ( ) { $ token = $ this -> tokenStorage -> getToken ( ) ; if ( ! $ token instanceof RememberMeToken && ! $ token instanceof UsernamePasswordToken ) { throw new ServerErrorException ( [ 'error_description' => 'The authorization server encountered an unexpected condition that prevented it from fulfilling the request.' , ] ) ; } return $ token -> getUsername ( ) ; }
Fetch username from authenticated token.

@return string Supplied username from authenticated token

@throw ServerErrorException If supplied token is not a standard TokenInterface instance.
Fetch username from authenticated token .