This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Acquiring the authentication token with Windows SSO

Hi everyone,

With the help of the following example, I can acquire the authentication token with Windows user or M-files user:

http://www.m-files.com/mfws/gettingstarted.html

var getToken = function (username, password, vault) {

    // Request an encrypted token with the login information.
    $.ajax({
        url: "example.org/.../authenticationtokens.aspx",
        type: "POST",
        dataType: "json",
        contentType: "application/json",
        data: JSON.stringify({ Username: username, Password: password, VaultGuid: vault }),
        success: processToken
    });
};

var processToken = function (token) {
    // Set the header.
    $.ajaxSetup({ headers: { "X-Authentication" : token.Value } });
};


Now, M-files 10 allows authentication with Windows SSO. I'd like to know how to use Windows SSO authentication to acquire the authentication token and how to use it automatically?

Thanks a lot.


Parents
  • Hi,

    From client side it is possible to use SSO authentication by making an ajax request to WebServiceSSO.aspx. This is a bit confusing as this page is part of M-Files Web and not M-Files Web Service (notice that there is no /REST in the url).

    $.get( 'example.org/WebServiceSSO.aspx )
    .done(connectedToServer)
    .fail(processError);


    This will authenticate against the Current Windows User using NTLM and save the session id to the cookie. The following ajax requests will use the session in the cookie when no authentication token in provided in the header.

    Important: With the SSO authentication, it is not possible to get a working authentication token (i.e. by making a get request to /session/authenticationtoken).

    Best regards,
    Mikko Roihuvuo, Developer Evangelist, M-Files
Reply
  • Hi,

    From client side it is possible to use SSO authentication by making an ajax request to WebServiceSSO.aspx. This is a bit confusing as this page is part of M-Files Web and not M-Files Web Service (notice that there is no /REST in the url).

    $.get( 'example.org/WebServiceSSO.aspx )
    .done(connectedToServer)
    .fail(processError);


    This will authenticate against the Current Windows User using NTLM and save the session id to the cookie. The following ajax requests will use the session in the cookie when no authentication token in provided in the header.

    Important: With the SSO authentication, it is not possible to get a working authentication token (i.e. by making a get request to /session/authenticationtoken).

    Best regards,
    Mikko Roihuvuo, Developer Evangelist, M-Files
Children
No Data