Moodle Version: Moodle 3.1.1+ (Build: 20160728) up-to-date. [AWS Ubuntu 14.04] - all plugins up-to-date
Moodle Mobile: 3.1.2 [custom app - phonegap guild published to Play Store]. Issue was observed on stock moodle app also.
Phone: Nexus 5 (6.0.1)
Oauth2 Plugin: this one
After oauth2 to my google account, while redirection from browser to app, I get attached error(see screenshot) on embedded browser. You can see http:// getting prefixed to app launch url scheme.
I started debugging launch.php file in local_mobile plugin. If I change the php header redirect code in the last else block to javascript redirect, it seems to work fine.
} else {
//header('Location: ' . $location); original code
//die; original code
?>
<script type="text/javascript">
window.location.href = '<?php echo $location ?>';
</script>
<?php
}
I tested this code for 'via Browser window (for SSO plugins)' setting also (for chrome browser). It seems to work fine.
Not sure if this issue was specific to me or others are also experiencing this behavior.