Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@555platform/author-js-sdk
Advanced tools
This section describes JavaScript SDK for 555 Auth Manager. Package can be installed with
npm i @555platform/author-js-sdk
This API requires valid Facebook, Google, Cima, PingID access token. The API will exchange the given access token for 555 JWT token. The registration API validates provided token and uses the user information to create 555 user and returns JWT token that then can be used to access all other 555 platform APIs.
mediaRegister(type, mediaToken, successCallback, errorCallback)
type – LOGIN_TYPE_FACEBOOK, LOGIN_TYPE_GOOGLEPLUS, LOGIN_TYPE_PINGID, LOGIN_TYPE_SSO, LOGIN_TYPE_CIMA
mediaToken – token
successCallback – when API succeeds this callback will receive JSON response.
failureCallback – in case of failure error information will be passed into this callback.
mediaRegisterAsync(type, mediaToken)
type – LOGIN_TYPE_FACEBOOK, LOGIN_TYPE_GOOGLEPLUS, LOGIN_TYPE_PINGID, LOGIN_TYPE_SSO, LOGIN_TYPE_CIMA
mediaToken – token
Returns promise that returns JSON payload on success and error on failure.
To get constants import them like this:
import {
LOGIN_TYPE_FACEBOOK,
LOGIN_TYPE_GOOGLEPLUS,
LOGIN_TYPE_PINGID,
LOGIN_TYPE_SSO,
LOGIN_TYPE_CIMA
} from 'author-js-sdk';
Register using email.
emailRegister(username, email, password, successCallback, errorCallback)
username – user name like first name and last name with optional middle name
email – user’s email
password – user’s password
successCallback – when API succeeds this callback will receive JSON response.
failureCallback – in case of failure error information will be passed into this callback.
emailRegisterAsync(username, email, password)
username – user name like first name and last name with optional middle name
email – user’s email
password – user’s password
Returns promise that returns JSON payload on success and error on failure.
Register using device unique id.
emailRegister(typeId, successCallback, errorCallback)
typeId - device uunique id
successCallback – when API succeeds this callback will receive JSON response.
failureCallback – in case of failure error information will be passed into this callback.
emailRegisterAsync(typeId)
typeId - device uunique id
Returns promise that returns JSON payload on success and error on failure.
This API allows to get user information associated with JWT token. This API can be used with any 555 token accept the ones obtained with anonymous login.
userInformation(token, successCallback, errorCallback)
token – 555 JWT access token
successCallback – when API succeeds this callback will receive JSON response.
failureCallback – in case of failure error information will be passed into this callback.
userInformationAsync(token)
token – 555 JWT access token
Returns promise that returns JSON payload on success and error on failure.
This API will validate if the token is valid. This API can be used with any 555 token accept the ones obtained with anonymous login.
validateUserAccessToken(token, successCallback, errorCallback)
token – 555 JWT access token
successCallback – when API succeeds this callback will receive JSON response.
failureCallback – in case of failure error information will be passed into this callback.
validateUserAccessTokenAsync(token)
token – 555 JWT access token
Returns promise that returns JSON payload on success and error on failure.
Returns if the token is valid or not.
Login using social media, SSO, Cima or PingID.
mediaLogin(type, mediaToken, successToken, errorCallback)
type – LOGIN_TYPE_FACEBOOK, LOGIN_TYPE_GOOGLEPLUS, LOGIN_TYPE_PINGID, LOGIN_TYPE_SSO, LOGIN_TYPE_CIMA
mediaToken – token
successCallback – when API succeeds this callback will receive JSON response.
failureCallback – in case of failure error information will be passed into this callback.
mediaLoginAsync(type, mediaToken)
type – LOGIN_TYPE_FACEBOOK, LOGIN_TYPE_GOOGLEPLUS, LOGIN_TYPE_PINGID, LOGIN_TYPE_SSO, LOGIN_TYPE_CIMA
mediaToken – token
Returns promise that returns JSON payload on success and error on failure.
Returns 555 JWT access token.
Login using email.
emailLogin(email, password, successCallback, errorCallback)
email – user’s email
password – user’s password
successCallback – when API succeeds this callback will receive JSON response.
failureCallback – in case of failure error information will be passed into this callback.
emailLoginAsync(email, password)
email – user’s email
password – user’s password
Returns promise that returns JSON payload on success and error on failure.
Returns 555 JWT access token.
Change password for email based user account.
emailAccountPasswordChange(token, email, currentPassword, newPassword, successCallback, errorCallback)
token – bearer token, it can be client or server
email – user’s email
currentPassword – user’s current password
newPassword – user’s new password
successCallback – when API succeeds this callback will receive JSON response.
failureCallback – in case of failure error information will be passed into this callback.
emailAccountPasswordChangeAsync(token, email, currentPassword, newPassword)
token – bearer token, it can be client or server
email – user’s email
currentPassword – user’s current password
newPassword – user’s new password
Returns promise that returns JSON payload on success and error on failure.
Login using device unique id.
deviceLogin(typeId, successCallback, errorCallback)
typeId - device uunique id
successCallback – when API succeeds this callback will receive JSON response.
failureCallback – in case of failure error information will be passed into this callback.
deviceLoginAsync(typeId, successCallback, errorCallback)
typeId - device uunique id
Returns promise that returns JSON payload on success and error on failure.
Returns 555 JWT access token.
Get server to server JWT
serverLogin(successCallback, errorCallback)
successCallback – when API succeeds this callback will receive JSON response.
failureCallback – in case of failure error information will be passed into this callback.
deviceLoginAsync(successCallback, errorCallback)
Returns promise that returns JSON payload on success and error on failure.
Returns 555 server to server JWT access token.
This API allows anonymous login. This is useful if applications that do not require concept of user.
anonymousLogin(userID, successCallback, errorCallback)
userID – optional string with user name or id. It can be empty.
successCallback – when API succeeds this callback will receive JSON response.
failureCallback – in case of failure error information will be passed into this callback.
anonymousLoginAsync(userID)
userID – optional string with user name or id. It can be empty.
Returns promise that returns JSON payload on success and error on failure.
Returns 555 JWT access token.
Logout API takes valid 555 JWT and adds it to blacklist so it cannot be used further to access 555 platform.
logout(token, successCallback, errorCallback)
token – 555 JWT token
successCallback – when API succeeds this callback will receive JSON response.
failureCallback – in case of failure error information will be passed into this callback.
logoutAsync(token)
token – 555 JWT token
Returns promise that returns JSON payload on success and error on failure.
This API will return object with decoded JWT’s header, claims and signature.
decodeToken(token)
token – valid 555 JWT token
APIs to retrieve new token with refresh token.
refreshTokenAsync(refreshToken)
refreshToken - refresh token
refreshToken(refreshToken, successCallback, errorCallback)
refreshToken - refresh token
successCallback – when API succeeds this callback will receive JSON response.
failureCallback – in case of failure error information will be passed into this callback.
Revoke specified refresh token
revokeRefreshTokenAsync(refreshToken)
refreshToken - refresh token
revokeRefreshToken(refreshToken, successCallback, errorCallback)
refreshToken - refresh token
successCallback – when API succeeds this callback will receive JSON response.
failureCallback – in case of failure error information will be passed into this callback.
This API allows for attaching profile to specified user. Profile can be arbitrary JSON object.
updateUserProfileAsync(token, userID, profileObject)
token - server to server token
userID - user id
profileObject - JSON object with profile data
updateUserProfile(token, userID, profileObject, successCallback, errorCallback)
token - server to server token
userID - user id
profileObject - JSON object with profile data
successCallback – when API succeeds this callback will receive JSON response.
failureCallback – in case of failure error information will be passed into this callback.
Find users based on query of profile data. For example,
const queryObject = {
'user_name': newUserName,
}
will search for user whose profile contains user_name equal to newUserName
queryUserProfileAsync(token, queryObject, isMatch, start, limit)
token - server to server token
queryObject - JSON object with query
isMatch - true to match field with value exactly, false will search for value contained in the field
start - pagination start index
limit - pagination count of entries returned
queryUserProfile(token, queryObject, isMatch, start, limit, successCallback, errorCallback)
token - server to server token
queryObject - JSON object with query
isMatch - true to match field with value exactly, false will search for value contained in the field
start - pagination start index
limit - pagination count of entries returned
successCallback – when API succeeds this callback will receive JSON response.
failureCallback – in case of failure error information will be passed into this callback.
Delete user with given user_id
deleteUserAsync(token, userID)
token - server to server token
userID - user id
deleteUser(token, userID, successCallback, errorCallback)
token - server to server token
userID - user id
successCallback – when API succeeds this callback will receive JSON response.
failureCallback – in case of failure error information will be passed into this callback.
After you npm i @555platform/author-js-sdk you can test it out with the following code:
let Auth = require("@555platform/author-js-sdk")
let authMgr = Auth.AuthManagerFactory({"authMgrApiUrl": "<555 auth manager url>", "apiVersion": "v1.1", "appkey": "<your app key>", "appsecret": "<your app secret"})
authMgr.anonymousLogin("Some Name")
.then(data => console.log(data))
.catch(error => console.log(error))
FAQs
JS SDK for 555 Auth Manager
The npm package @555platform/author-js-sdk receives a total of 6 weekly downloads. As such, @555platform/author-js-sdk popularity was classified as not popular.
We found that @555platform/author-js-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.