Hi all, I have a button that on click opens an iframe with a given authUrl. The code is:
var service = getOAuthService();
var authUrl = service.getAuthorizationUrl();
var authButton = CardService.newTextButton()
.setText("Login")
.setAuthorizationAction(CardService.newAuthorizationAction()
.setAuthorizationUrl(authUrl)).setTextButtonStyle(CardService.TextButtonStyle.FILLED);
The button opens an iframe on a separated window wich authenticates a user in a certain service, but I need to embed this iframe on my gmail
addon, so the authentication method is done through the addon.
My idea was to retrieve the URL of the iframe to show it on the addon using the HtmlOutput and <iframe> tag,
but debugging the code (Logger.log(authUtl)) the given URL doesn't match with the Url of the opened iframe.
Iframe Url has 2 parameters, but only 1 is stored in authUrl variable:
...../auth?code=XXXXX&state=YYYYY ----> State is the parameter registered in authUrl variable.
Any ideas to solve this, or some other method to embed this process in my addon??
authUrl has a response_type=code in case this could help.
Best regards and thank you.