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:
<panel>
<button buttontype="push" height="38" left="287" name="Authenticate with Google" onclick="onAuthenticateButtonClick()" top="147" width="135"/>
<ogscript>
<![CDATA[
function openGoogleAuthPage() {
var authURL = "https://accounts.google.com/o/oauth2/auth?client_id=CLIENT_ID" +
"&redirect_uri=urn:ietf:wg:oauth:2.0:oob" +
"&response_type=code" +
"&scope=https://www.googleapis.com/auth/youtube.readonly" +
"&access_type=offline";
browser.openURL(authURL);
}
function onAuthenticateButtonClick() {
openGoogleAuthPage();
}
]]>
</ogscript>
</panel>
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!
------------------------------
Joseph LaMere
Broadcast Engineer
Children's Minnesota
------------------------------