OAuth 2.0 Authentication in Dashboard

Hi,

I’m currently working on a custom panel in Ross Dashboard and I’m trying to set up a button that can launch a web browser to authenticate with Google using OAuth 2.0. Here’s what I’ve tried so far:

Button Configuration: I’ve created a button with the onclick event set to call a function (onAuthenticateButtonClick()) defined in my ogScript.

Script Setup: My ogScript contains a function (openGoogleAuthPage()) that uses browser.openURL() to open the Google OAuth authentication URL. Here is a simplified version of my setup:

<!-- Embedding the ogScript -->
<ogscript>
    <![CDATA[
    function openGoogleAuthPage() {
        var authURL = "https://accounts.google.com/o/oauth2/auth?client_id=CLIENT_ID" +
            "&amp;redirect_uri=urn:ietf:wg:oauth:2.0:oob" +
            "&amp;response_type=code" +
            "&amp;scope=https://www.googleapis.com/auth/youtube.readonly" +
            "&amp;access_type=offline";
        browser.openURL(authURL);
    }

    function onAuthenticateButtonClick() {
        openGoogleAuthPage();
    }
    ]]>
</ogscript>

However, when I click the button, nothing happens - no browser is launched.

Is it possible to launch a web browser from a Ross Dashboard button using ogScript?

If yes, what is the correct method or function to achieve this? Are there any specific permissions or settings I need to configure in Dashboard to allow this behavior?

If not, what are the recommended alternative approaches for implementing OAuth 2.0 authentication in a Dashboard panel?

Any guidance or suggestions would be greatly appreciated!

Thank you!