Load custom template from MENU_CALLBACK Here's my current situation: I have an external authentication platform that loads in Drupal via an iframe. When the user is authenticated, the external application redirects the user to a Drupal endpoint I set up using:

function mymodule_menu() {

    $items['mymodule/oauth'] = array(
        'title' =&gt; 'My Module Receiver',
        'page callback' =&gt; 'mymodule_oauth',
        'access callback' =&gt; TRUE,
        'type' =&gt; MENU_CALLBACK,
        'file' =&gt; 'mymodule.pages.inc'
    );

    return $items;
}


And then my callback:

function myapp_oauth() {

    // Does some stuff, authenticates the user, etc

    echo '
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" &gt;
&lt;body&gt;
&lt;p&gt;Please wait...&lt;/p&gt;
&lt;script type="text/javascript"&gt;
  // Check if we are in an iframe or not
  if (window.location.href != window.parent.location.href) {
    // Reload the parent page
    window.parent.location.reload();
  } else {
    // Not in an iframe, so go to the home page
    window.location.href = "' . base_path() . '";
  }
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
';
    exit;

}


This seems like an incredibly sloppy way to handle this to me, I would prefer not to have to exit the application, and ideally I would want to simply define a tpl template file to load in place of the theme files for this page. Can someone recommend a better way to handle this?
You can define a theme function that uses a template file, and then use theme function to for the menu callback output.
The following is example code for Drupal 7; similar code can be used for Drupal 6.

function mymodule_theme() {
  return array(
    'mymodule_oath' =&gt; array(
      'variables' =&gt; array('id' =&gt; NULL), // This is the list of the variables that will be passed to the template file. 
      'template' =&gt; 'mymodule_oath', // Change this to the template file name.
    ),
  );
}

function mymodule_oath() {
  // Does some stuff, authenticates the user, etc.

  print theme('mymodule_oath', array('id' =&gt; 10));
  return NULL;
}