First, on the main window you need to open an new popup window, this will open a centered window:
$('.openwindow').click(function(){
var uri = 'https://my-oauth-server-url'
var left = (screen.width/2 - 400)
var top = (screen.height/2 - 350)
window.open(uri, 'oauth window','resizable=yes, width=800, height=700, top='+top+', left='+left)
});
Once you have the popup window opened you will need to reload the main window (opener window) with new content and close the popup window.
window.opener.location.replace('/oauthok');
window.close();