0

I'm trying to implement the functionality to log in with Google from the Outlook add-in. From the web version of outlook, everything working well, but from the desktop, I can't find a way how to open the Sign in with Google popout. Instead, it just opened a new tab on the browser.

https://developers.google.com/identity/sign-in/web/reference

code example:

gapi.auth2.authorize({
  client_id: 'CLIENT_ID.apps.googleusercontent.com',
  scope: 'email profile openid',
  response_type: 'id_token permission'
}, function(response) {
  if (response.error) {
    // An error happened!
    return;
  }
  // The user authorized the application for the scopes requested.
  var accessToken = response.access_token;
  var idToken = response.id_token;
  // You can also now use gapi.client to perform authenticated requests.
});

I see that zoom add-in for outlook show this popup, so any idea how to do it? enter image description here Thanks!

Taras Kovalenko
  • 2,323
  • 3
  • 24
  • 49

1 Answers1

0

In order for Oauth2 to work it should always open the login and consent screen in the users installed browser on their machine. This is to give the user the opportunity to check the url bar at the top of the page.

Without having the URL bar at the top of the page someone could create a page that looks like googles login and consent screens and then the user would be typing their login and password into a potentially malicious site.

As far as I know google has shut down all options of opening the consent screen in anything other than an installed browser. it wont even work in an IFrame last i checked.

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
  • yes, you're right. but the question of how zoom did it with its own add-in and how we can do the same :) In the case of login with Microsoft, it works well with the default Microsoft javascript auth library. – Taras Kovalenko Jun 21 '21 at 11:51
  • 1
    They are probably using OpenId connect For authentication. Where as you are using Oauth2 for authorization. Check Google signin its not the same. – Linda Lawton - DaImTo Jun 21 '21 at 12:03
  • I believe that Zoom is calling DisplayDialogAsync (https://learn.microsoft.com/en-us/javascript/api/office/office.ui?view=excel-js-preview) and pointing to https://zoom.us/office365/login (at least from your screenshot) – Outlook Add-ins Team - MSFT Jun 23 '21 at 20:14