MachineAuth : SessionType
A SessionType that allows machine to machine communication between Node.js servers. This would only be used in Node.js applications. This SessionType requires a client id and a client secret, which are obtained from Auth0.
Kind: global class
- MachineAuth :
SessionType
- new MachineAuth(sdk)
- .clearCurrentApiToken(audienceName) ⇒
Promise
- .getCurrentApiToken(audienceName) ⇒
Promise
- .isAuthenticated(audienceName) ⇒
boolean
Param | Type | Description |
---|---|---|
sdk | Object |
An instance of the SDK so the module can communicate with other modules |
Example
const ContxtSdk = require('@ndustrial/contxt-sdk');
const contxtSdk = new ContxtSdk({
config: {
auth: {
clientId: '<client id>',
clientSecret: '<client secret>'
}
},
sessionType: 'machineAuth'
});
Removes an audience's API token from the in-memory token storage
Kind: instance method of MachineAuth
Param |
---|
audienceName |
Gets the current API token (used to communicate with other Contxt APIs). Will get and store a token or use a previously acquired and stored token.
Kind: instance method of MachineAuth
Fulfills: string
apiToken
Param | Type | Description |
---|---|---|
audienceName | string |
The audience you wish to get an API for |
Tells caller if the app is authenticated with a particular service.
Kind: instance method of MachineAuth
Param |
---|
audienceName |