Follow the steps below to create a Google application to allow users to access their Google Drive within Webmail on the Documents page.
1.Sign in to MDaemon Remote Administration and go to the Google Drive page (located under Main » Webmail Settings), and turn on the Enable Google Drive Integration option.
2.In a separate browser tab, sign in to your Google Account and go to the Google API console.
3.If on the Project List, click NEW PROJECT, or if on the Manage Resources page, click (+) CREATE PROJECT.
4.Type a Project name, such as "Google Drive for MDaemon," then click Edit if you wish to edit the Project ID, or leave it set to the default value. Note: the Project ID cannot be changed after the project is created.
5.If you have an Organization Resource, choose it in Location. Otherwise, leave it set to "No organization."
6.Once loaded, click + ENABLE APIS AND SERVICES.
7.In the search field, type "Google Drive", select Google Drive API, and click Enable.
8.In the left pane, under APIs & Services, click Credentials.
9.Click + Create Credentials at the top of the page, and select API Key in the drop-down menu.
10.Copy Your API key (there is a Copy to Clipboard icon beside it).
11.Switch to your browser's MDaemon tab and paste it into the Google Drive API Key field on the Google Drive page in MDaemon (or save it somewhere else if you wish to do that later).
12.In the left pane, under APIs & Services, click OAuth consent screen.
13.Under User Type, select External, and click Create. Note: if you have an Organization Resource, or depending on your app's Publishing Status, choosing Internal might be a better choice. See the Publishing Status note below for more information.
14.Enter the App name (e.g. Google Drive for Webmail), a Support email address for users to contact, and a Developer email address for Google to contact about changes to your project. That is all that's required on this page for setup, but depending on your particular organization or verification requirements, you can also enter your company logo and links to your Terms of Service and Privacy Policy (see above). The Authorized domains fields will be filled in for you automatically when you add the Redirect URIs in a later step below. Note: This info is used for the Consent screen that will be presented to users for authorizing Webmail to access the user's Google Drive.
15.Click Save and Continue.
16.Click ADD OR REMOVE SCOPES, and copy/paste the URIs below (you can copy/paste them all at once) into the box under "Manually add scopes." Then click ADD TO TABLE.
https://www.googleapis.com/auth/userinfo.email
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/documents
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.readonly
https://www.googleapis.com/auth/drive.metadata
https://www.googleapis.com/auth/drive.photos.readonly
https://www.googleapis.com/auth/drive.activity.readonly
https://www.googleapis.com/auth/spreadsheets
17.Click Save and Continue.
18.Under Test Users, click ADD USERS, enter each Google account whose Google Drive MDaemon will be accessing through this app, and click ADD (see the note below about your app's Publishing Status).
19.Click Save and Continue.
20.On Summary, click BACK TO DASHBOARD at the bottom of the page.
21.Click Credentials in the left pane, click (+) Create Credentials, and select OAuth client ID.
22.In the "Application type" drop-down box, select Web application, and under "Authorized redirect URIs", click + ADD URIs. Enter the Redirect URI. The Redirect URI displayed on the Google Drive page in MDaemon is an example built from your Default Domain's SMTP host name, which should work for that domain's users when signing in to Webmail. You should add additional Redirect URIs to your app for any additional MDaemon domains your users go to when signing in to Webmail. For example, "https://mail.example.com/WorldClient.dll?View=OAuth&AuthRequest=GoogleDrive" would work for any of your users who go to mail.example.com when signing in to Webmail. If you also host a domain called, "mail.company.test", then you would also need to enter a Redirect URI for that domain, i.e. "https://mail.company.test/WorldClient.dll?View=OAuth&AuthRequest=GoogleDrive".
23.Click CREATE.
24.Copy the values in Your Client ID and Your Client Secret to the Google Drive Client ID and Google Drive Client Secret boxes on the Google Drive page in MDaemon. You can also enter your Google Drive API Key if you didn't do that earlier.
|
Publishing Status — These instructions are for creating a Google app with the Publishing Status set to "Testing". This requires you to add each specific Google account that will be using the app to access their Google Drive, and it is limited to 100 users. Further, in Webmail when your users are asked to authorize MDaemon to access Google, a warning message will be displayed "to confirm the user has test access to your project but should consider the risks associated with granting access to their data to an unverified app." Also, authorization expires after seven days, therefore each user would be required to reauthorize Google access every week.
If you wish to remove these requirements and limitations then you must change your status to "In Production", which may or may not require you change your User Type from external to internal, to go through an app verification process, or both. For more information on app verification and publishing status, see the following Google articles: Setting up your OAuth consent screen and OAuth API verification FAQs.
|
Authorizing Google Drive in Webmail
Once you have created your Google Drive app and configured MDaemon's Google Drive page according to the instructions above, each user who wishes to access their Google Drive in Webmail must first authorize access to do so. To do this, each user should:
1.Sign in to Webmail.
2.Click the Options icon in the top right corner, and click Cloud Apps.
3.Click Setup Google Drive (this will open an OAuth 2.0 page).
4.Click Connect to Google Drive.
5.If not signed in, Google Drive will ask them for sign-in information or to choose an account.
6.They may be presented with a warning message that says, "Google hasn’t verified this app. You’ve been given access to an app that’s currently being tested. You should only continue if you know the developer that invited you." Click Continue.
7.Select which Google Drive features Webmail will be able to access, click Continue.
8.A final page will display stating that MDaemon is now connected to Google Drive. They can then close this window.
9.They can then access Google Drive from their Documents page in Webmail. |