GithubHelp home page GithubHelp logo

billschnoebelen / onshape-mern-oauth-external Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 18.58 MB

Basic Onshape oauth loggin sample using the MERN Stack. This is intended to work outside of Onshape.

License: MIT License

JavaScript 87.76% HTML 7.40% CSS 4.83%

onshape-mern-oauth-external's Introduction

A MERN Stack app which uses Oauth2 to login to Onshape. There are two simple examples to retrieve data.

  1. Get user units.
  2. Get a gltf of an assembly.

This consist of both a frontend react client and a backend express node server. Mongo is used to keep track of session data. In production, these are run from a server. This, however, is setup to all run locally.

Onshape is used for Authentication . Based on the Authentication , the react-router handles the Authorization and routes the user to the appropriate route. This is a very simple example and should not be used for production.

More Info:



Prerequisites

Built With

Getting Started

Instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Usage

Use this as a template to create your own external Onshape app using the MERN Stack.

Required

A .env file is require at the root of the client and server.

Client .env

REACT_APP_OS_OAUTH_CLIENT_KEY=<OS_OAUTH_CLIENT_KEY>

Server .env

PORT=4000
NODE_ENV=DEVELOPMENT
APP_NAME=onshape-mern-oauth-external
SESSION_SECRET=godtac
OS_OAUTH_CLIENT_KEY=<OS_OAUTH_CLIENT_KEY>
OS_OAUTH_SECRET_KEY=<OS_OAUTH_SECRET_KEY>
OS_OAUTH_REDIRECT_URL=http://localhost:4000/oauthRedirect
OS_OAUTH_AUTHORIZATION_URL=https://oauth.onshape.com/oauth/authorize
OS_OAUTH_TOKEN_URL=https://oauth.onshape.com/oauth/token
OS_OAUTH_USER_PROFILE_URL=https://cad.onshape.com/api/users/sessioninfo
JWT_ACCESS_SECRET=ad4d5548a61ad283abf3f89d361b79b18a37a69970610150ffb2895917f2b71bea

License

Distributed under the MIT License. See LICENSE for more information.

onshape-mern-oauth-external's People

Contributors

billschnoebelen avatar

Stargazers

 avatar

Watchers

 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.