Giter Site home page Giter Site logo

aps-pkce-auth-autocad-dotnet-addin's Introduction

APS PKCE AUTH AUTOCAD DOTNET ADDIN

Platforms .NET License

oAuth2

Introduction

This sample demonstrates a quick workflow to generate a three legged token from a AutoCAD 2024 .NET Addin using 3-Legged Token with Authorization Code Grant (PKCE)

How it works

1 – Type NETLOAD command to load the DLL of this sample

2 – User access the AutoCAD addin command by typing GetApsThreeLeggedToken in AutoCAD Console

3 – App redirects the user to APS authorization server

4 – After logging in and allowing access, authorization server sends credential code to call-back url and this request is intercepted by the AutoCAD addin command.

5 – AutoCAD addin command sends credential code with code verifier to Exchange it for a token

6 – Oauth API returns the token (including refresh token) to AutoCAD

7 – The AutoCAD addin command opens a TaskDialog to show obtained access token

Setup

Prerequisites

  1. APS Account: Learn how to create a APS Account, activate subscription and create an app at this tutorial.
  2. Visual Studio: Community or Pro.
  3. .NET basic knowledge with C#

Running locally

Clone this project or download it. It's recommended to install GitHub desktop. To clone it via command line, use the following (Terminal on MacOSX/Linux, Git Shell on Windows):

git clone https://github.com/yiskang/aps-pkce-auth-autocad-dotnet-addin

Visual Studio (Windows):

Go to ApsAuthACAD folder, change client id and callback url with your own in Command.cs, and then build the solution in Visual Studio.

Type NETLOAD command to load the complied DLL.

Further Reading

Troubleshooting

  1. Not being redirected: Make sure to add your callback url to your aps app.

  2. Not retrieving the token: Make sure you've provided the proper callback to httplistener

  3. Not able to read ACC/BIM 360 data with acquired token: Make sure to provision the APS App Client ID within the BIM 360 Account, learn more here. This requires the Account Admin permission.

License

This sample is licensed under the terms of the MIT License. Please see the LICENSE file for full details.

Written by

Eason Kang @yiskang, Developer Advocacy and Support

aps-pkce-auth-autocad-dotnet-addin's People

Contributors

yiskang avatar

Stargazers

Joao Martins avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.