Enumeration DirectorySessionInterfaceSignal

The DirectorySessionInterfaceSignal lists all the signals that may be sent by the DirectorySessionInterface.

These signals are emitted by the DirectorySessionInterface when

/** 
* Sample to illustrate the DirectorySessionInterface signals handling.
*/
import { DirectorySessionInterface, DirectorySessionInterfaceSignal, tListenerCallback, ConnectionData, InfiniteEvent } from 'generated_files/documentation/appinfiniteapi';

// directory session has been created previously
let lDirectorySession : DirectorySessionInterface;
// not relevant at the moment
let onLoginFailed : tListenerCallback;
// not relevant at the moment
let onSignOut : tListenerCallback;
// not relevant at the moment
let onRefreshAccessRightsFailed : tListenerCallback;

// parse the build list and user infos
const onLoginSuccess = (pEvent: InfiniteEvent, _pCallbackData: Object | undefined) : void =>
{
// Get the Attachment
const lAttachments: ConnectionData = pEvent.attachments;

// iterate over project and output project info
for (const lProjectId in lAttachments.projects) {
const lProjectInfo = lAttachments.projects[lProjectId];
console.log('project name : ' + lProjectInfo.projectname + ' project id :' + lProjectInfo.projectid);
console.log(JSON.stringify(lProjectInfo.builds));
}
// output user infos
console.log('user logged in : ' + lAttachments.user.name);
console.log('user teams : ' + JSON.stringify(lAttachments.teams));
};

// connect to signals
lDirectorySession.addEventListener(DirectorySessionInterfaceSignal.LoginSuccess, onLoginSuccess);
lDirectorySession.addEventListener(DirectorySessionInterfaceSignal.LoginFailed, onLoginFailed);
lDirectorySession.addEventListener(DirectorySessionInterfaceSignal.LoggedOff, onSignOut);
lDirectorySession.addEventListener(DirectorySessionInterfaceSignal.AccessRightsRefreshed, onLoginSuccess);
lDirectorySession.addEventListener(DirectorySessionInterfaceSignal.AccessRightsRefreshFailed, onRefreshAccessRightsFailed);

Please refer to DirectorySessionInterface for more information.
Events

Enumeration Members

AccessRightsRefreshFailed: "accessRightsRefreshFailed"

Signal sent by the DirectorySessionInterface when the refresh access rights procedure has failed after a call to DirectorySessionInterface.refreshAccessRightsInfo.

The attachment for events of this type is an InfiniteError.

AccessRightsRefreshed: "accessRightsRefreshed"

Signal sent by the DirectorySessionInterface when the list of available builds and projects have been refreshed i.e. after a call to DirectorySessionInterface.refreshAccessRightsInfo.

The attachment for events of this type is a ConnectionData.

LoggedOff: "loggedOff"

Signal sent by the DirectorySessionInterface when the user has effectively logged off i.e. after a call to DirectorySessionInterface.closeDirectorySession.

No attachment for events of this type.

LoginFailed: "loginFailed"

Signal sent by the DirectorySessionInterface when the login procedure has failed after a call to DirectorySessionInterface.getPopupBasedAuthenticationUrl.

The attachment for events of this type is an InfiniteError.

LoginSuccess: "loginSuccess"

Signal sent by the DirectorySessionInterface when the user has been logged in after a call to DirectorySessionInterface.getPopupBasedAuthenticationUrl.

The attachment for events of this type is a ConnectionData.

TokenUpdated: "tokenUpdated"

Signal sent by the DirectorySessionInterface when a token has been refreshed.

This signal is sent when the authentication bearer (DirectorySessionInterface.getAuthenticationBearer), extended authentication bearer (DirectorySessionInterface.getExtendedAuthenticationBearer) or the http bearer (DirectorySessionInterface.getHttpBearer) is updated. There is no information on the type of the token updated, it is the application responsibility to call DirectorySessionInterface.getAuthenticationBearer, DirectorySessionInterface.getExtendedAuthenticationBearer and DirectorySessionInterface.getHttpBearer to know the new values of the bearers.

No attachment for events of this type.