--- title: "Authentication" slug: "150-core-authentication" updated: 2025-03-19T14:52:47Z published: 2025-03-19T16:03:18Z canonical: "docs.developer.comcast.com/150-core-authentication" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.developer.comcast.com/llms.txt > Use this file to discover all available pages before exploring further. # Authentication **Authentication Module 1.5.0 | Core SDK** ## Usage To use the Authentication module, you can import it into your project from the Firebolt SDK: ``` import { Authentication } from '@firebolt-js/sdk' ``` ## Overview A module for acquiring authentication tokens. ## Methods ### device Get a device token scoped to the current app. ``` function device(): Promise ``` Promise resolution: Capabilities: | Role | Capability | | --- | --- | | uses | xrn:firebolt:capability:token:device | #### Examples Acquire a Firebolt device identity token JavaScript: ``` import { Authentication } from '@firebolt-js/sdk' let token = await Authentication.device() console.log(token) ``` Value of `token`: ``` 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' ``` **JSON-RPC:** Request: ``` { "jsonrpc": "2.0", "id": 1, "method": "Authentication.device", "params": {} } ``` Response: ``` { "jsonrpc": "2.0", "id": 1, "result": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" } ``` --- ### root Get a root device token. ``` function root(): Promise ``` Promise resolution: Capabilities: | Role | Capability | | --- | --- | | uses | xrn:firebolt:capability:token:root | #### Examples Acquire a Firebolt root device identity token JavaScript: ``` import { Authentication } from '@firebolt-js/sdk' let token = await Authentication.root() console.log(token) ``` Value of `token`: ``` 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' ``` **JSON-RPC:** Request: ``` { "jsonrpc": "2.0", "id": 1, "method": "Authentication.root", "params": {} } ``` Response: ``` { "jsonrpc": "2.0", "id": 1, "result": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" } ``` --- ### session Get a destributor session token. ``` function session(): Promise ``` Promise resolution: Capabilities: | Role | Capability | | --- | --- | | uses | xrn:firebolt:capability:token:session | #### Examples Acquire a distributor session token JavaScript: ``` import { Authentication } from '@firebolt-js/sdk' let token = await Authentication.session() console.log(token) ``` Value of `token`: ``` 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' ``` **JSON-RPC:** Request: ``` { "jsonrpc": "2.0", "id": 1, "method": "Authentication.session", "params": {} } ``` Response: ``` { "jsonrpc": "2.0", "id": 1, "result": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" } ``` --- ### token [Deprecated] This method is deprecated as of since version 0.9.0. Please use `Authentication module has individual methods for each token type.` as a replacement. ``` function token( type: TokenType, options: object, ): Promise ``` --- ## Types ### TokenType ``` TokenType: { PLATFORM: 'platform', DEVICE: 'device', DISTRIBUTOR: 'distributor', }, ``` --- ### AuthenticationTokenResult ``` type AuthenticationTokenResult = { value: string expires?: string type?: string } ``` ---