Onymos Raises $12M Series A: Learn why

onymos-logo

onymosAccess.login

To authenticate the user using one of the leading social authentication (OAuth 2.0) providers.

function socialLogin (authProvider) {
var accessObj = {
authProvider: authProvider
};

OnymosAccess.login(
accessObj,

function loginSuccess (statusMessage) {
console.log(statusMessage);
// Optionally, call getAuth to get authData
var authDataObject = OnymosAccess.getAuth();
},

function loginFailure (error) {
console.log(error);
},

options);

} /* end function socialLogin */

authProvider

String

The name of the social authentication provider (e.g., ‘apple’, ‘facebook’, ‘google’, etc).

accessObject

Object

An object with the property authProvider.

{
authProvider: string // one of ‘apple’, ‘facebook’, or ‘google’
}
options
Scope

String

Additional requested permissions, from the social authentication providers.
Facebook: Comma-separated list as described here.
Google: Space-separated list as described under “Google Sign-In” here.

Note:

  1. Additional permissions will reduce the number of users logging into your app.
  2. Some permissions might require review from the authentication provider. Please contact Onymos support to request such additional permissions.

Example:

var options = {
scope: ‘public_profile, email’ // Facebook comma-separated
};
var options = {
scope: ‘profile email’ // Google space-separated
};

onymosAccess.logout

To de-authenticate the logged-in user.

function socialLogout() {

OnymosAccess.logout(

function logoutSuccess (statusMessage) {
console.log(statusMessage);
},

function logoutFailure (error) {
console.log(error);
});

} /* end function socialLogout */

onymosAccess.getAuth

To obtain the authentication details of the logged-in user.

function getAuth() {
var authObject = OnymosAccess.getAuth();
/* ------
authObject = {
authProvider: Authentication Provider : e.g., 'apple', 'facebook', or 'google',
userId: Unique ID of authenticated user, if available,
userName: Name of Logged-in user,
userPhoto: URL to Photo of Logged-in user, if available,
nativeAuth: Object with additional Authentication provider details
};
Returns NULL if session is not authenticated.
------ */
} /* end function getAuth */
Note: This is a synchronous call.

onymosAccess.listenForAuth

To set a Callback function that will be invoked when a session authenticates or de-authenticates.

function authCallbackFunction(authData) {
if (authData) {
console.log('User : ' + authData.userName + ' is logged in.');
}
else {
console.log('User has logged out.');
}
} /* end function authCallbackFunction */
OnymosAccess.listenForAuth(authCallbackFunction);
Note: This is a synchronous call.

onymosAccess.stopListenForAuth

Remove all Callback functions that were setup to listen to Auth changes.

function stopAuthCallbacks() {
OnymosAccess.stopListenForAuth();
} /* end function stopAuthCallbacks */
Note: This is a synchronous call.

onymosAccess.getOtherUsersInfo

To obtain information about users of the app, other than the logged-in user.

function getOtherUsersInfo() {
OnymosAccess.getOtherUsersInfo(
function getOtherUsersInfoSuccess (userInfoRecords) {
/* ------
userInfoRecords[] = {
userId: unique_user_id,
userName: username,
userPhoto: user_photo_url
}; ------ */
},
function getOtherUsersInfoFailure (error) {
console.log(error);
},
options);
} /* end function getOtherUsersInfo */
options
searchString

string

Search for users with userName starting with searchString provided.

numberOfRecords

string

The number of userRecords you want returned in this function.

onymosAccess.signUp

To register the user when you are using Onymos Hosting or your own cloud database.

function signUp (authProvider, email, password, phone) {
var signupParamsObject = {
authProvider: authProvider,
userEmail: email,
userPassword: password,
userPhone: phone
};
OnymosAccess.signUp(
signupParamsObject,
function signUpSuccess (statusMessage) {
console.log(statusMessage);
},
function signUpFailure (error) {
console.log(error);
});
} /* end function signUp */
authProvider

String

Should be ‘account’ when using Onymos Hosting or your own cloud database.

userEmail

String

The user’s email address.

userPassword

String

The user’s password.

userPhone

String

The user’s phone number.

signupParamsObject

Object

An object with authProvider, userEmail, userPassword, and userPhone properties.

{
authProvider: string // 'account'
userEmail: string // user's email
userPassword: string // user's password
userPhone: string // user's phone
}

onymosAccess.resetPasswordRequest

For the user to request to reset their password when using Onymos Hosting or your own cloud database.

function resetPasswordRequest (authProvider, email) {
var passwordResetParamsObject = {
authProvider: authProvider,
userEmail: email,
};
OnymosAccess.sendPasswordResetEmail(
passwordResetParamsObject,
function sendPasswordResetEmailSuccess (statusMessage) {
console.log(statusMessage);
},
function sendPasswordResetEmailFailure (error) {
console.log(error);
});
} /* end function resetPasswordRequest */
authProvider

String

Should be ‘account’ when using Onymos Hosting or your own cloud database.

userEmail

String

The user’s email address.

passwordResetParamsObject

Object

An object with authProvider and userEmail properties.

{
authProvider: string // 'account'
userEmail: string // user's email
}

onymosAccess.resetPassword

To reset the user’s password when using Onymos Hosting or your own cloud database.

function resetPassword (authProvider, email, oldPw, newPw) {
var passwordResetParamsObject = {
authProvider: authProvider,
userEmail: email,
oldPassword: oldPw,
newPassword: newPw
};
OnymosAccess.resetPassword(
passwordResetParamsObject,
function resetPasswordSuccess (statusMessage) {
console.log(statusMessage);
},
function resetPasswordFailure (error) {
console.log(error);
});
} /* end function resetPassword */
authProvider

String

Should be ‘account’ when using Onymos Hosting or your own cloud database.

userEmail

String

The user’s email address.

oldPassword

String

The user’s current password.

newPassword

String

The user’s new password.

resetPasswordParamsObject

Object

An object with authProvider, userEmail, oldPassword, and newPassword properties.

{
authProvider: string // 'account'
userEmail: string // user's email
oldPassword: string // user's old password
newPassword: string // user's new password
}

Think differently about app development

Download our free white paper today to learn how Onymos Features can maximize the value of your developer resources — and shave days or weeks off your development timeline.

Get your free white paper