Skip to content

This basic .NET Core WebAPI back-end sample implements a basic list of Buckets and Objects with an Autodesk Forge 2 Legged OAuth. 3 Legged Authentication is also available, you can switch between the two OAuth services. The front-end was desiged with pure HTML + JavaScript (jQuery, Bootstrap), no ASPx features (i.e. no WebForms or MVC on this sa…

Notifications You must be signed in to change notification settings

Ibrahim5aad/forge-clean-architecture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Forge Sample - Clean Architecture

.NET

oAuth2 OSS Model-Derivative Viewer

Intermediate

Description

This basic .NET Core WebAPI sample implements a basic list of Buckets and Objects with an Autodesk Forge 2 Legged OAuth.

3 Legged Authentication is also available, you can switch between the two OAuth services.

The front-end was desiged with pure HTML + JavaScript (jQuery, Bootstrap). It includes: create and delete buckets, upload, delete and translate object (including .zip files). This code is based on this tutorial.

Setup

Prerequisites

  1. Forge Account: Learn how to create a Forge Account, activate subscription and create an app at this tutorial.
  2. Visual Studio: Either Community 2017+ (Windows) or Code (Windows, MacOS).
  3. .NET Core basic knowledge with C#
  4. JavaScript basic knowledge with jQuery
  5. ngrok: Routing tool, download here

Running locally

Clone this project: git clone github.com/Autodesk-Forge/model.derivative-WebAPI-sample.git

Visual Studio (Windows):

Right-click on the project, then go to Debug. Adjust the settings as shown below.

Visual Sutdio Code (Windows, MacOS):

Open the folder, at the bottom-right, select Yes and Restore. This restores the packages (e.g. Autodesk.Forge) and creates the launch.json file. See Tips & Tricks for .NET Core on MacOS.

At the .vscode\launch.json, find the env vars and add your Forge Client ID, Secret and callback URL. Also define the ASPNETCORE_URLS variable. The end result should be as shown below:

"env": {
    "ASPNETCORE_ENVIRONMENT": "Development",
    "ASPNETCORE_URLS" : "http://localhost:3000",
    "FORGE_CLIENT_ID": "your id here",
    "FORGE_CLIENT_SECRET": "your secret here",
    "FORGE_WEBHOOK_URL": "your ngrok address here: e.g. http://abcd1234.ngrok.io",
},

Run ngrok http 3000 to create a tunnel to your local machine, then copy the address into the FORGE_WEBHOOK_URL environment variable.Ngrok is a cross-platform application that exposes local server ports to the Internet.

Further Reading

Documentation:

About

This basic .NET Core WebAPI back-end sample implements a basic list of Buckets and Objects with an Autodesk Forge 2 Legged OAuth. 3 Legged Authentication is also available, you can switch between the two OAuth services. The front-end was desiged with pure HTML + JavaScript (jQuery, Bootstrap), no ASPx features (i.e. no WebForms or MVC on this sa…

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published