This tip comes from "Extending IBM SmartCloud Applications in 30 Minutes" by Michael Blackstock from IBM.
The session covers how to integrate Social Business Toolkit-based apps with on-premise applications. It starts with a quick introduction to the Social Business Toolkit and walks you through the download process, setting up your Eclipse IDE and creating Social Business Toolkit app in 30 minutes. This tip specifically covers the OAuth UIs for IBM SmartCloud and IBM Connections, how to add OAuth credentials to your app, and where to find the Social Business Toolkit Helper Applications.
2. 2
Please Note
IBM’s statements regarding its plans, directions, and intent are subject to change or withdrawal without notice at IBM’s sole
discretion.
Information regarding potential future products is intended to outline our general product direction and it should not be relied
on in making a purchasing decision.
The information mentioned regarding potential future products is not a commitment, promise, or legal obligation to deliver
any material, code or functionality. Information about potential future products may not be incorporated into any contract.
The development, release, and timing of any future features or functionality described for our products remains at our sole
discretion
Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The
actual throughput or performance that any user will experience will vary depending upon many factors, including
considerations such as the amount of multiprogramming in the user’s job stream, the I/O configuration, the storage
configuration, and the workload processed. Therefore, no assurance can be given that an individual user will achieve
results similar to those stated here.
3. How does your application authenticate with Smart Cloud
or IBM Connections?
OAuth is the mechanism used by Smart Cloud and IBM Connections to authenticate
external applications with the IBM Connections and Smart Cloud environments.
OAuth provides a means for your application to authenticate with a service provider without
knowing the users credentials. You will need to be a Smart Cloud organization administrator
to generate the application key.
Lets take a look at how you can create an OAuth id and secret that your application can use.
17
4. Smart Cloud OAuth UI.
18
As a Smart Cloud organization administrator, you can create new OAuth credentials. To do this,
log in and Navigate to the “Internal Apps” left navigator via the “Admin->Manage Organization”
masthead drop down menu.
5. Smart Cloud OAuth UI.
19
You will need to register your OAuth application. Below an OAuth 2.0 registration has created.
OAuth 2.0 requires a call-back URL to your application.
The format is: https://<your host>:<port>/<your context root>/service/oauth20_cb
6. Smart Cloud OAuth UI.
20
You can obtain your OAuth
credentials by selecting the
drop down next to your newly
registered application.
Select: “Show Credentials”.
7. IBM Connections OAuth.
21
OAuth credentials for IBM Connections can be create by the Connection
administrator using wsadmin tool.
/bin/wsadmin.sh
execfile('oauthAdmin.py')
OAuthApplicationRegistrationService.addApplication("<appId>",
"<appDescritpion>", "<https://yourAppURL:port/service/oauth20_cb>")
8. How you add your OAuth crendetials to your application.
“managed-beans.xml”
managed-beans.xml should be added to your application and will contain your OAuth
credentials and configuration information. Lets create one:
<managed-bean>
<managed-bean-name>SCLabs</managed-bean-name>
<managed-property>
<property-name>consumerSecret</property-name>
<value>8e9e00ad767976b3dfe979b9de6d702ef7c60c5 ...</value>
</managed-property)
<property-name>consumerKey</property-name>
<value>app_20088093_1379354351324</value>
</managed-property>
...
</managed-bean>
22
9. How you add your OAuth crendetials to your application.
“managed-beans.xml”
Other essential information in managed-beans.xml is the authorization URL's for the service
provider.
<managed-bean>
. . .
<managed-property>
<property-name>authorizationURL</property-name>
<value>https://apps.na.collabservtest.lotus.com/manage/oauth2/authorize</value>
</managed-property>
<managed-property>
<property-name>accessTokenURL</property-name>
<value>https://apps.na.collabservtest.lotus.com/manage/oauth2/token</value>
</managed-property>
23
10. What are the SBT Helper Applications?
The SBT helper applications are war files that enable the Social Business Toolkit. These
applications are installed once and are used by all of your Social Business Applications.
They are available in the /sbtsdk/redist/war folder
– sbt.boostrap211.war
– sbt.dojo180.war
– sbt.jquer182.war
– sbt.war
24
11. How are the Social Business Toolkit helper applications
referenced?
The SBT help applications are referenced in two places
– Your Web.xml file
<servlet>
...
<servlet-class>com.ibm.sbt.jslibrary.servlet.LibraryServlet</servlet-class>
<init-param>
<description>This is an init parameter sbt context root</description>
<param-name>toolkitUrl</param-name>
<param-value>%local_server%/ghsbt</param-value>
</init-param>
</servlet>
25
12. How are the SBT helper applications referenced?
The second place is in your application
– JavaScript file
<link href="/sbt.bootstrap211/bootstrap/css/bootstrap.css" rel="stylesheet">
<link href="/sbt.bootstrap211/bootstrap/css/bootstrap-responsive.css"
rel="stylesheet">
<link rel="stylesheet" href="/sbt.dojo180/dijit/themes/claro/claro.css"
media="screen">
…
<script type="text/javascript" src="/sbt.dojo180/dojo/dojo.js"></script>
26