A walkthrough and more details are available on Google Drive SDK docs.
-
Configure IIS (or another web server) to publish your ASP.NET application to a publicly-accessible URI (e.g.
http://www.example.com). -
Clone DrEdit's git repo and init submodules:
git clone [email protected]:googledrive/dredit.git && cd dredit git submodule init git submodule update --recursive -
Create an API project in the Google APIs Console.
-
Select the Services tab in your API Project, and enable the Drive API and Drive SDK.
-
Select the API Access tab in your API Project, click Create an OAuth 2.0 client ID.
-
In the Branding Information section, provide a name for your application (e.g. "DrEdit"), and click Next. Providing a product logo or a homepage URL is optional.
-
In the Client ID Settings section, do the following:
- Select Web application for the Application type
- Click the more options link next to the heading, Your site or hostname.
- List the hostname of the web server configured in step 2 in the Authorized Request URIs and JavaScript Origins fields.
- Click Create Client ID.
-
Register DrEdit as described in Enable the Drive SDK using the following values:
- Set the default MIME types
text/plainandtext/html, and the default extensionstxtandhtml. - Ensure that the set of redirect URIs includes the URI of your web server. The same URL must be provided for the
Open URLandCreate URLfields. - Add the
Google API Scopesofhttps://www.googleapis.com/auth/userinfo.email,https://www.googleapis.com/auth/userinfo.profileandhttps://www.googleapis.com/auth/drive.install. - For icons, use the example icons provided in the
chromewebstoredirectory.
- Set the default MIME types
-
Open the
dotnet\DrEdit.slnsolution in Visual Studio. -
Edit
Models\ClientCredentials.csand replaceCLIENT_ID,CLIENT_SECRETandREDIRECT_URIwith the values from the Google APIs Console under the API Access tab for the project. -
Edit
Scripts\app.jsand replaceYOUR_APP_IDwith the value of theCLIENT_IDfrom the Google APIs Console under the API Access tab for the project. -
Build the solution and deploy it on the web server configured in step 2.
-
Test the app by browsing to the web server URI (e.g.
http://www.example.com). -
Continue reading to find out how DrEdit is constructed, and how to modify it to work for your own application's needs.