Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@blinkmobile/bm-identity
Advanced tools
Provides easy management of authenication for our CLI via a single identity.
npm install @blinkmobile/bm-identity --save
const pkg = require('./package.json');
const BlinkMobileIdentity = require('@blinkmobile/bm-identity');
const blinkMobileIdentity = new BlinkMobileIdentity(pkg.name);
If no LoginOptions are passed, a browser based login process will start. This is how users can login using a social account e.g. Google.
login (options: LoginOptions) => Promise{String}
interface LoginOptions {
username? : String|Boolean, // Can also pass true, and username will be prompted for
password? : String, // Will be prompted for password if username is truthy
email? : String|Boolean, // Can also pass true to be prompted for email address
sms? : String|Boolean, // Can also pass true to be prompted for phone number
storeJwt? : Boolean, // Set to true to store jwt on local file system, defaults to false
}
blinkMobileIdentity.login()
.then(jwt => {
// Use jwt access token.
});
storeJwt
Optiontrue
, will use @blinkmobile/blinkmrc User Config to store on local file system for later use.logout () => Promise
blinkMobileIdentity.logout();
assumeAWSRole (additionalParameters: Object) => Promise{AssumedRoleCredentials}
interface AssumedRoleCredentials {
accessKeyId : String,
secretAccessKey : String,
sessionToken : String
}
blinkMobileIdentity.assumeAWSRole()
.then(credentials => {
// Use AWS credentials
});
If accessToken
is not passed, will attempt to get the access token from the file system.
See Auth0 Profile Structure for available properties.
getProfile (accessToken: String | undefined) => Promise{Auth0Profile}
blinkMobileIdentity.getProfile()
.then(profile => {
// Use Auth0 profile
});
To create an AccessToken
using BlinkM Deployment Keys or retrieve the AccessToken
stored after a successful login:
If the following environment variables are set:
BLINKM_ACCESS_KEY
BLINKM_SECRET_KEY
These will be used to create an AccessToken
getAccessToken () => Promise{string}
blinkMobileIdentity.getAccessToken()
.then(jwt => {
// Use access token
});
Helper function to get the payload for a JWT
getPayload () => Promise{Object}
blinkMobileIdentity.getPayload()
.then(payload => {
// Use payload
});
Get and set the current tenant. Also get and remove list of previously used tenants.
getTenants () => Promise{Tenants}
setTenant (tenantName: String) => Promise{Tenants}
removeTenant (tenantName: String) => Promise{Tenants}
interface Tenants {
current : String,
previous : Array{String}
}
blinkMobileIdentity.getTenants()
.then(tenants => {
// Use tenants
});
blinkMobileIdentity.setTenant('TenantName')
.then(tenants => {
// Tenant was set
});
blinkMobileIdentity.removeTenant('TenantName')
.then(tenants => {
// Tenant was removed
});
3.3.0 - 2018-01-24
getPayload
function for getting Access Token payloadFAQs
Helper functions for Blink Mobiles single identity
The npm package @blinkmobile/bm-identity receives a total of 11 weekly downloads. As such, @blinkmobile/bm-identity popularity was classified as not popular.
We found that @blinkmobile/bm-identity demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.