Tutorial: window.authenticate

window.authenticate

Provides credentials to authentication requests

Example

On Application event

let app = fin.desktop.Application.wrap('targetUuid');

app.addEventListener('window-auth-requested', evt => {
    let win = fin.desktop.Window.wrap(evt.uuid, evt.name);
    
    win.authenticate('userName', 'P@assw0rd', ()=> {}, (reason, err) => {
        console.log("failure:", err);
    });
});

On Window event

let win = fin.desktop.Window.wrap('targetUuid', 'targetName');

win.addEventListener('auth-requested', evt => {
    
    win.authenticate('userName', 'P@assw0rd', ()=> {}, (reason, err) => {
        console.log("failure:", err);
    });
});