Skip to content

Authentication

TJ Horner edited this page Sep 6, 2017 · 2 revisions

With v1.0.0 came support for various types of authentication. This is specified in opts.authMethod as part of the constructor. Here are the types of authentication you can use to connect to a printer:

  • thingiverse - Authenticate with a Thingiverse access_token and username.
  • access_token - If you already have an access token from the printer itself, you can use this directly.
  • local_authorization - Authenticate by pressing the knob on the printer.
  • reflector - Remotely access the printer with its ID and a Thingiverse token.

Thingiverse Authentication

To authenticate with this method, you must provide these additional parameters to the options object:

  • thingiverseToken - The access_token obtained through Thingiverse. More on obtaining Thingiverse tokens.
  • username - The username of the Thingiverse account that the token belongs to.
  • printerIp - The IP address of the printer you are connecting to.

You may also optionally include these parameters:

  • printerPort - The port to connect to on the printer. Default: 9999

Access Token Authorization

To authenticate with this method, you must provide these additional parameters to the options object:

  • accessToken - The access token obtained via the printer's HTTP(S) server.
  • printerIp - The IP address of the printer you are connecting to.

You may also optionally include these parameters:

  • printerPort - The port to connect to on the printer. Default: 9999

Local Authentication

To authenticate with this method, you must provide these additional parameters to the options object:

  • printerIp - The IP address of the printer you are connecting to.

You may also optionally include these parameters:

  • printerPort - The port to connect to on the printer. Default: 9999

Reflector Authentication

To authenticate with this method, you must provide these additional parameters to the options object:

  • accessToken - The access_token obtained through Thingiverse. More on obtaining Thingiverse tokens.
  • printerId - The ID of the printer to connect to (it's usually the printer's MAC address w/o colons).
Clone this wiki locally