Skip to main content

Authn Documentation

Authn is a major authentication service for SME Connect that provides the main gateway into the SME Connect services. Without a successful JWT token generated from Authn, users will be unable to log into the SME Connect application as they will be denied access to the Presence, Signal, and Logging services.

This documentation is ordered in two main ways: API Docs and Classes & Functions.

API Docs contains information about the main endpoints and services in presence. This includes:

  • Logging into Authn
  • JWT Endpoint
  • Logging out of Authn

The sections below provide a broad overview of some of the more complex processes involved with Presence.

The login process occurs once a user has received a JWT from either the Oauth or ClientAuth services. These services authenticate a user's identity. The JWT is used to log the user into the Authn service by giving them a session cookie.

With a successful completion of login, the user will use the Authn session cookie to a request a JWT from the jwt endpoint in Authn. This token is critical as it is the authorization token that will grant the user privileges to the Presence, Signal, and Graylog services.

High-level diagram of the logging in process when a user signs into SME Connect using Google:

Diagram showing OAuth login process

Important Terminology

  • CAC - Common Access Card. This is a “smart” ID card for military personnel, contractors, or DoD employees. In the backend, there is a special method and process for CAC logins.
  • Cookies - 🍪 SME Connect uses HTTP cookies, or small pieces of data, to store user credentials, such as session IDs for a backend service like Presence or Signal.
  • Embedded Node (EmNode) - User classification of someone using the Tools Gateway. This was the previous name used for the Tools Gateway. In Presence, the EmbeddedNode is a type/device.
  • JWT - JSON Web Token. These tokens are created/signed during the user authentication. In Presence, a JWT endpoint is used to authenticate a user for the assets service.
  • Onsite Expert - User type of someone using an iPad
  • Remote Expert - User type of someone using the Web UI
  • SME - subject matter expert
  • Tools Gateway - A device that connects any USB or serial-enabled tool to the iPad and the remote expert. Previously, this device was known as the “Embedded Node”, which you may still hear used. The Tools Gateway supports tools such as digital cameras, digital micrometers, digital multimeters, and optical borescope. For backend APIs, the Tools Gateway and its connected tools are each considered individual users, with the tools having a direct connection with a Tools Gateway (known as “EmNode” or “Embedded Node”).
  • Websocket - A websocket enables real-time, two-way communication between a client and server. For SME Connect, socket events help communicate to users when others have joined the room, are requesting to join a room, and when users have adjusted their video/audio settings. Websockets prevent the need for having to poll the presence server for specific data (such as changes in the room's members list)

Editing the Documentation

This documentation is created using docusaurus. This website builder has been setup to combine files containing OpenAPI configurations and TypeDoc.

The documentation files can be found in the docs directory in this repository's source files. When editing these files, do not change the file names as docusaurus has been set up to find and use these file names. The following list highlights what is contained in each file and what contents should be updated/edited when updating the documentation.

  • docusaurus.config.ts
    • This configuration file contains the metadata and configuration settings for creating the docusaurus website. It also includes the navigation settings. If copying this repository, update only the title property with the name of the service.
  • index.md
    • This file is the homepage information for the documentation. If copying this repository, edit the entire contents of this file.
  • indext.ts
    • This file contains the entry points for TypeDoc to compile the documentation for the exported functions/classes. If editing or adding additional TypeDoc comments to functions and classes, check that the files are included in index.ts. If copying this repository, edit the entire contents of this file.
  • openapi.yaml
    • This file is the OpenAPI standard for the service's API. It contains information about endpoint's actions, requests, and responses. When editing or adding an endpoint, edit this file to reflect any changes made. If copying this repository, edit the entire contents of this file.
  • typedoc.json
    • This file contains the TypeDoc configuration used to compile and generate the documentation for this repository's functions and classes. When editing this file, edit only the name.
  • typedocIntro.md
    • This file contains the introductory information for the TypeDoc section of the documentation. This section highlights information about the service's functions and classes used. If copying or editing this repository, edit only the name property.
  • assets
    • This folder contains images that can be used in the typedocIntro.md and index.md files. Reference a relative URL path of: img/[FILE PATH] for Docusaurus to adequately find the image.

Documentation Resources

To understand more about this documentation and the resources used to compile it, consult the following resources:

  • Docusaurus.io - The main website compiler.
  • OpenAPI - The OpenAPI standard used to create the API documentation
  • TypeDoc - The TypeScript documentation generator. It uses comments in files to create documentation