Skip to main content
Version: 11.2

$.udb.login()

note

This article is about the login() function of the $.udb object.

$.udb.login()

Logs in.

Returns a UdbPromise object.

Syntax

$.udb.login( *user*, *password*, [options] )

*options* ::= {
[page]: *page-name*
}

The required user is a string that identifies the user. The required password is a string that defines the password.

Options is a struct that can have the following items, all of which are optional.

Page-name is a string that defines the page to display if the login succeeds.

Examples

$.udb.login('ABC', 'DEF');
$.udb.login('ABC', 'DEF', { page: 'MyFirstPage' })
.then(() => {
// executed on 'MyFirstPage'
})
.catch((() => {
// the login was not successful
});
.finally(() => {
// executed after success / failure is handled
});
$.udb.login('ABC', 'DEF')
.then(() => {
alert('Welcome!');
});
note

The beforelogin event only fires for the initial submission of credentials (user name and password). If the application calls $.udb.login({ checkCode: code }) to submit a multi-factor authentication (MFA) code, or if single sign-on (SSO) is configured, beforelogin (and, for SSO, login) does not fire. See the "Multi-factor authentication and SSO" section of beforelogin for details.

EventApplies toOccurs when
beforeloginPage objectsBefore each login action
loginPage objectsAfter each login action