This is a documentation for Flashphoner version 1.0.5.973
We recommend you upgrade to the last version and check the actual documentation

Autologin

Autologin feature used for personal user pages. 

How it works

  1. User types his login and password and presses login button on web-page.
  2. User watches his personal page.
  3. Javascript phone initialization starts after the page has been loaded.
  4. Javascript phone uses token parameter and send this parameter to Flashphoner-server.
  5. Flashphoner server requests third-party authentication server by HTTP.
  6. Third-party authentication server returns XML with login details.
  7. Flashphoner-server uses this details for registration of SIP account.

How to try autologin

  1. Make sure that Javascript phone works for you using stadard login scheme.
  2. Insert such tag into HTML page, where Javascript phone loaded:
    PhoneJS.html
    <input id="auto_login_token" type="hidden" value="123456789abcdef"/>
    

    Here we have added element with id=token and value=123456789abcdef
    Javascript phone will use this element for autologin process

  3. Edit server-side properties file and set third-party authentication server here:
    flashphoner.properies
    auto_login_url=flashphoner.com/my_auto_login_url.xml
    
    Specify auto_login_url without URL scheme. Right: flashphoner.com/my_auto_login_url.xml Wrong: http://flashphoner.com/my_auto_login_url.xml


    You should specify your own auto login URL here.
    Flashphoner will use http:// scheme for specified URL and send request to
    http://flashphoner.com/my_auto_login_url.xml?token=123456789abcdef for this example.
    Restart Flashphoner server to apply the changes.
    See also Configuring section

  4. Create authentication XML document and upload this document into web-server.
    The web-server will be used as third-party authentication server for tests.
    Your document should look like this:
    my_auto_login_url.xml
    <root auth="true" sip_login="my_sip_login" sip_password="my_sip_password" sip_server="my_sip_server"/>
    

    Here:

    auth true if you permit access for this token
    sip_login SIP login
    sip_password SIP password
    sip_server IP address or domain name of SIP server

    Open this document in the browser and make sure it contains correct credentials.
    Sure, you can use php or any server-side script which returns valid XML,
    then your URL may have such form: auto_login_url=flashphoner.com/my_auto_login_url.php

  5. Uncomment strings in file js/flashLoader.js
    $(function() { flashvars.token = $("#auto_login_token").val(); });
    
  6. Refresh browser cache and try to open the HTML page with Javascript phone again.
    It should use autologin and you should be success logged with credentials, which described in the XML document.
    Try to make call.

FAQ

How to structure that XML file for multiple SIP users?

Click here to expand...

XML my_auto_login_url.xml just a simple example for one SIP account.

If you want to use more SIP accounts, you should use server-side script like PHP, JSP, ASP, CGI, e.t.c. Your script should return suitable xml file:

JSP example: http://docs.flashphoner.com/download/attachments/10616871/auth.jsp?version=1&modificationDate=1320302119000
In this example, server-side JSP script returns 2000-2099 (100 different accounts) for load testing.
You can read more here: http://docs.flashphoner.com/display/FP973/Loadtest

When you define auto_login_token value 123456789abcdef,
flashphoner does request to your url: http://yoururl/my_auto_login_url.xml?token=123456789abcdef
You should return suitable xml file. You may use this token info during xml creation.

Examples:

1. You can encode SIP credentials in this token 123456789abcdef
Your server-side script know how to decode this token to SIP credentials
So, you can return suitable XML

2. You can have database record, where your token corresponds SIP credentials
Your server-side script can get SIP credentials by token from database
So, you can return suitable XML

3. You can have in memory record, where your token corresponds SIP credentials
Your server-side script can get SIP credentials by token from memory
So, you can return suitable XML

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.