Tip from IBM Connect 2014: Extending IBM SmartCloud Applications in 30 Minutes

13
© 2014 IBM Corporation AD101 : How to extend IBM SmartCloud Applications in 30 Minutes Michael Blackstock, IBM

description

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.

Transcript of Tip from IBM Connect 2014: Extending IBM SmartCloud Applications in 30 Minutes

Page 1: Tip from IBM Connect 2014: Extending IBM SmartCloud Applications in 30 Minutes

© 2014 IBM Corporation

AD101 : How to extend IBM SmartCloud Applications in 30 Minutes

Michael Blackstock, IBM

Page 2: Tip from IBM Connect 2014: Extending IBM SmartCloud Applications in 30 Minutes

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.

Page 3: Tip from IBM Connect 2014: Extending IBM SmartCloud Applications in 30 Minutes

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

Page 4: Tip from IBM Connect 2014: Extending IBM SmartCloud Applications in 30 Minutes

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.

Page 5: Tip from IBM Connect 2014: Extending IBM SmartCloud Applications in 30 Minutes

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

Page 6: Tip from IBM Connect 2014: Extending IBM SmartCloud Applications in 30 Minutes

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”.

Page 7: Tip from IBM Connect 2014: Extending IBM SmartCloud Applications in 30 Minutes

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>")

Page 8: Tip from IBM Connect 2014: Extending IBM SmartCloud Applications in 30 Minutes

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

Page 9: Tip from IBM Connect 2014: Extending IBM SmartCloud Applications in 30 Minutes

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

Page 10: Tip from IBM Connect 2014: Extending IBM SmartCloud Applications in 30 Minutes

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

Page 11: Tip from IBM Connect 2014: Extending IBM SmartCloud Applications in 30 Minutes

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

Page 12: Tip from IBM Connect 2014: Extending IBM SmartCloud Applications in 30 Minutes

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

Page 13: Tip from IBM Connect 2014: Extending IBM SmartCloud Applications in 30 Minutes

39

Acknowledgements and Disclaimers Availability. References in this presentation to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates.

The workshops, sessions and materials have been prepared by IBM or the session speakers and reflect their own views. They are provided for informational purposes only, and are neither intended to, nor shall have the effect of being, legal or other guidance or advice to any participant. While efforts were made to verify the completeness and accuracy of the information contained in this presentation, it is provided AS-IS without warranty of any kind, express or implied. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, this presentation or any other materials. Nothing contained in this presentation is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software.

All customer examples described are presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual environmental costs and performance characteristics may vary by customer. Nothing contained in these materials is intended to, nor shall have the effect of, stating or implying that any activities undertaken by you will result in any specific sales, revenue growth or other results.

© Copyright IBM Corporation 2014. All rights reserved. U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

IBM, the IBM logo, ibm.com, IBM Connections, and WebSphere are trademarks or registered trademarks of International Business Machines Corporation in the United States, other countries, or both. If these and other IBM trademarked terms are marked on their first occurrence in this information with a trademark symbol (® or ™), these symbols indicate U.S. registered or common law trademarks owned by IBM at the time this information was published. Such trademarks may also be registered or common law trademarks in other countries. A current list of IBM trademarks is available on the Web at “Copyright and trademark information” at www.ibm.com/legal/copytrade.shtml

Eclipse is the registered trademark of the Eclipse Foundation Inc. Java is the registered trademark of Oracle. Apache Tomcat and Tomcat are trademarks of the Apache Software Foundation.

Other company, product, or service names may be trademarks or service marks of others.