@mindconnect/mindconnect-nodejs
Version:
NodeJS Library for Siemens Insights Hub Connectivity - TypeScript SDK for Insights Hub and Industrial IoT - Command Line Interface - Insights Hub Development Proxy (Siemens Insights Hub was formerly known as MindSphere)
65 lines (64 loc) • 1.71 kB
TypeScript
import { MindConnectBase, TokenRotation } from "./mindconnect-base";
/**
* User Authenticator for Backend Authentication in NodeJS
*
* @see https://developer.mindsphere.io/concepts/concept-authentication.html#calling-apis-from-backend
*
* @export
* @class UserAuth
* @extends {MindConnectBase}
* @implements {TokenRotation}
*/
export declare class UserAuth extends MindConnectBase implements TokenRotation {
private _token;
private _gateway;
/**
* Creates an instance of UserAuth.
* extract token from http request headers (req.get("authorization"))
*
* @param {string} token
* @param {string} gateway
*
* extract token from curreny http request:
* Gateway has to follow the https://gateway.{region}.{mindsphere-domain} schema
*
* @see https://developer.mindsphere.io/concepts/concept-authentication.html#calling-apis-from-backend
*
* @memberOf UserAuth
*/
constructor(token: string, gateway: string);
/**
/**
* * Returns true; MindSphere Gateway is taking care of this
*
* @returns {Promise<boolean>}
*
* @memberOf BrowserAuth
*/
RenewToken(): Promise<boolean>;
/**
* * Returns ""; MindSphere Gateway is taking care of this
*
* @returns {Promise<string>}
*
* @memberOf BrowserAuth
*/
GetToken(): Promise<string>;
/**
* returns the configured gateway
*
* @returns {string}
*
* @memberOf BrowserAuth
*/
GetGateway(): string;
/**
*
* * Returns ""; MindSphere Gateway is taking care of this
*
* @returns {string}
*
* @memberOf BrowserAuth
*/
GetTenant(): string;
}