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-client.properties
    auto_login_url=flashphoner.com/my_auto_login_url.xml
    

    You should specify your own auto login URL here.
    Flashphoner will send such GET request to that url:

    http:///.../.../...?token=...?swfUrl=...?pageUrl=...



  4. Restart Flashphoner server to apply the changes.See also Configuring section

  5. 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 registered="..." login="..." authenticationName="..." password="..." outboundProxy="..." domain="..." port="..." visibleName="..."/>
    

    * Please note - format was changed from flashphoner client v.1.0.193. Click to expand and check old format
    Old format is:
    my_auto_login_url.xml
    <root auth="..." sip_login="..." sip_password="..." sip_server="..."/>
    

    Here:

    Field Description
    registered
    auth
    True if you permit access for this token
    login
    sip_login
    Name of your SIP account
    authenticationName Authentication name for your SIP account
    password
    sip_password
    Password for your SIP account
    domain
    sip_server
    IP address or domain name of your SIP server
    outboundProxy IP address or domain name of your outbound proxy
    port Port for SIP signaling connect (usually 5060)
    visibleName Visible name of your SIP account

    Open this document in the browser and make sure it contains correct credentials.
    Sure, you can use PHP or any server-side script to generate XML dynamically,
    Your url will loks like this in that case

    auto_login_url=http://flashphoner.com/my_auto_login_url.php 


  6. Uncomment strings in file js/flashLoader.js
    $(function() {$(function() {
      flashvars.token = $("#auto_login_token").val();
    });
    


  7. 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/FPN/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.