« People of Lesbos take gay group to court over term 'Lesbian' | Main| Watch out when you download the Sametime 8.0.1 server »

Sametime 8.0.1 Connect Web API Toolkit Hint and Tip.

Category

Sametime 8.0.1 now includes the Connect Web API Toolkit.  This allows you to put Sametime Awareness on a web page using the Sametime 8.0.1 client as the engine to resolve users and do the chat etc. What's actually happening is that the Sametime 8.0.1 client is loading a mini web server, which in turn is loading a servlet (stwebapi), which is then communicating with the Sametime Connect Client. So something like this.

ST ConnectWebAPI
The webpage, loads the stylesheet and the JavaScript file from the mini Sametime web server from port 59449.  Which returns information and events, and receives requests from the web page.

I have to be honest here, I am a little disturbed that 3rd party webpages now have the opportunity to interact with my Sametime connect client, for example, I could have code on this page that tries to communicate with your Sametime Connect WEB Api servlet, and I won't get any authentication request etc.  I really hope no buffer overrun type things are discovered here.  I am worried that this is potentially a huge hole in the Sametime client, and into your organization.  So for me personally, I'm wary of using it in environments where users can access external websites (which is almost everywhere).

You can be logged in on a web page as Fred Smith, and the Sametime Client could be logged in as Joanne Blogs, and when Fred clicks on a user to chat in the web page, the chat window that appears will be for user Joanne chatting with the other person.  So different to the behaviour you may be use to from Sametime Links and something to be aware of.

If you do have a firewall installed on your machine, you're also likely to receive a firewall warning when you hit a page which is trying to hit your Sametime Client, so you will have to accept that to see the awareness in a page.

Anyway back on to my hint/tip.  Using the Connect client for awareness is all well and good, but what if you're on a webpage in an internet cafe, or you're on a machine that has an old Sametime Connect client.  Well if you're using the Connect Web API toolkit, then you'll get nothing, no awareness.  So what you really want is someway of identifying that Connect Web API is available, and if it isn't use STLinks instead.  I couldn't find an example that shows how to do this, and I'm not sure IBM have thought about it too much.

Anyway this is what I came up with.

These few lines are the standard lines to load/initialize the ConnectWebAPI :

<!-- Step #1: Import the ST Connect Web API Stylesheet -->
<link rel="stylesheet" href="http://localhost:59449/stwebapi/main.css" type="text/css" />

<!-- Step #2: Import the ST Connect Web API getStatus JavaScript include file -->
<script type="text/javascript" src="http://localhost:59449/stwebapi/getStatus.js"></script>

So now before we decide if we want to use Sametime Links or the Connect Web API, we need to check to see if  ConnectWebAPI is available.  We do this by checking for a variable that is declared in the getStatus.js file. I make that easier to reference by wrapping it in a Javascritp function.

<Script>
function IsWebConnectAvailable(){
    if (self.getstatus) {
        //The Sametime Connect Client is available
        return  true;
    } else {
        //The Sametime Connect Client is available
        return false;
    }
}
</script>

We can now reference that function when we want to see if we want to use STLinks code or ConnectWebAPI code.

<script>
if ( IsWebConnectAvailable()) {
    //Use the ConnectWeb API code here as it's available
    alert('Connect Web API is available');
} else {
    //Use STLinks code here as Connect Web API is not available
    alert('Connect Web API is available');
}
</script>

So if you want to intelligently use the right client that should get you started.

I noticed yesterday that IBM's API documentation now includes this great paragraph.
This information contains sample application programs in source language, which illustrate programming techniques on various operating platforms. You may copy, modify, and distribute these sample programs in any form without payment to IBM, for the purposes of developing, using, marketing or distributing application programs conforming to the application programming interface for the operating platform for which the sample programs are written.

These examples have not been thoroughly tested under all conditions. IBM, therefore, cannot guarantee or imply reliability, serviceability, or function of these programs.

Each copy or any portion of these sample programs or any derivative work, must include a copyright notice as follows: © (your company name) (year). Portions of this code are derived from IBM Corp. Sample Programs. © Copyright IBM Corp. _enter the year or years_. All rights reserved.


So I should now include, the following:
© Epilio 2008. Portions of this code are derived from IBM Corp. Sample Programs. © Copyright IBM Corp. 2008. All rights reserved.

I would also like to include the following, if IBM uses any of my sample code, please do the following:
Each copy or any portion of these sample programs or any derivative work, must include a copyright notice as follows: © (your company name) (year). Portions of this code are derived from Epilio. Sample Programs. © Copyright Epilio _enter the year or years_. All rights reserved.

This only applies to IBM, other companies and individuals can use my sample code without this copyright notice.

Comments

Gravatar Image1 - Carl

As part of our normal design process, we did do a formal security risk assessment before launching the web api feature in Sametime 8.0.1. We believe that the risks are low relative to the value, especially when used with intranet based enterprise web apps where user identity is tightly controlled. The resulting actions from the feature, we believe, are limited and generally not harmful - eg: launching a blank chat window.

We will continue to closely monitor feedback on this feature.

Rob Ingram
Product Manager, IBM Lotus Sametime

Gravatar Image2 - Hi Carl,

we would like to implemnt this in our lotus Sametime limited version 8.0 Environemnt.

can u put some light on it ? would be a great help !!

Gravatar Image3 - I am a security researcher for a large quasi government entity - we use Notes & ST 7.5.1 - not integrated. I have found a potential vulnerability with ST port 59449 on our system. Can we get an email thread going - I want to see if I can develop this into a POC and escalate to IBM - The link below points to a previous 0 day (2007)exploit that I reported to IBM - who fixed it. I developed a POC which was an smtp inbound email message that if pre-viewed, opened or forwarded - ran arbitrary code of my choice - payload size was around 9000+ bytes.

{ Link }

Dan


Gravatar Image4 - I am a security researcher for a large quasi government entity - we use Notes &amp; ST 7.5.1 - not integrated. I have found a potential vulnerability with ST port 59449 on our system. Can we get an email thread going - I want to see if I can develop this into a POC and escalate to IBM - The link below points to a previous 0 day (2007)exploit that I reported to IBM - who fixed it. I developed a POC which was an smtp inbound email message that if pre-viewed, opened or forwarded - ran arbitrary code of my choice - payload size was around 9000+ bytes.<br /><br />{ <a href="{ Link } rel="nofollow" target ="blank">Link</a> }<br /><br />Dan <br /><br />

Gravatar Image5 - is there an example code which uses STLinks when ConnectAPI is not available? I want the same to be incorporated in my website.

Gravatar Image6 - @Kiran, did you read the post above?

<script>
if ( IsWebConnectAvailable()) {
//Use the ConnectWeb API code here as it's available
alert('Connect Web API is available');
} else {
//Use STLinks code here as Connect Web API is not available
alert('Connect Web API is available');
}
</script>

Gravatar Image7 - Thanks Carl for your reply. I read the code snippet you pasted above, what I am looking for is a sample code which uses STLinks to get sametime awareness. I have a working code for the same which uses connect web API.

Gravatar Image8 - The stlinks sdk documentation contains examples for showing awareness.

Gravatar Image9 - Hi, I am trying to open an sametime window chat and send a message to the contact I just opened. Is it possible?

Thank you for the attention

Gravatar Image10 - @9 Perhaps you could expand your question more, because if you open your window and type text then press send it will send the message.

Gravatar Image11 - @10, hi it has to be something automatic, for example: one user picks a task from the internal app, and the manager needs to know the the task was picked, so my ideia was about when the user picks a task, the manager will received a message by st, telling him that the task was picked.

Thank you for the attention

Gravatar Image12 - @11 The Web Connect API doesn't have that option to send a 1-1 message. You could send an announcement using the API though to a specific person. Lookup "announce" in the SDK

Gravatar Image13 - @11 Hi, I checked here in the "listservices" in the st api, for me it shows as disable. Pls how can I activate this option?

Thank you again for your attention

Gravatar Image14 - @13
1. The administrator will need to enable announcements, it is a policy I believe.

2. If you are using embedded Sametime inside Notes, you need to make sure you have a full Sametime license, and not the free entitlement. As I don't think you can do it with the free version. Mind you, you also aren't licensed to write API integration with the free Sametime entitlement either.

Gravatar Image15 - Hi Carl, I tried to implement this feature. Though my SameTime is running my port 59449 is closed. Can please tell me is there any way to start this local server?

Thanks,
Omkar

Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::rolleyes:;-)