TIBCO Runtime Agent™ Authentication API: User's Guide
TIBCO Runtime Agent™ Authentication API: User's Guide
Important Information
SOME TIBCO SOFTWARE EMBEDS OR BUNDLES OTHER TIBCO SOFTWARE. USE OF SUCH EMBEDDED OR BUNDLED TIBCO SOFTWARE IS SOLELY TO ENABLE THE FUNCTIONALITY (OR PROVIDE LIMITED ADD-ON FUNCTIONALITY) OF THE LICENSED TIBCO SOFTWARE. THE EMBEDDED OR BUNDLED SOFTWARE IS NOT LICENSED TO BE USED OR ACCESSED BY ANY OTHER TIBCO SOFTWARE OR FOR ANY OTHER PURPOSE. USE OF TIBCO SOFTWARE AND THIS DOCUMENT IS SUBJECT TO THE TERMS AND CONDITIONS OF A LICENSE AGREEMENT FOUND IN EITHER A SEPARATELY EXECUTED SOFTWARE LICENSE AGREEMENT, OR, IF THERE IS NO SUCH SEPARATE AGREEMENT, THE CLICKWRAP END USER LICENSE AGREEMENT WHICH IS DISPLAYED DURING DOWNLOAD OR INSTALLATION OF THE SOFTWARE (AND WHICH IS DUPLICATED IN THE LICENSE FILE) OR IF THERE IS NO SUCH SOFTWARE LICENSE AGREEMENT OR CLICKWRAP END USER LICENSE AGREEMENT, THE LICENSE(S) LOCATED IN THE LICENSE FILE(S) OF THE SOFTWARE. USE OF THIS DOCUMENT IS SUBJECT TO THOSE TERMS AND CONDITIONS, AND YOUR USE HEREOF SHALL CONSTITUTE ACCEPTANCE OF AND AN AGREEMENT TO BE BOUND BY THE SAME. This document contains confidential information that is subject to U.S. and international copyright laws and treaties. No part of this document may be reproduced in any form without the written authorization of TIBCO Software Inc. TIBCO, The Power of Now, TIBCO ActiveMatrix BusinessWorks, and TIBCO Administrator are either registered trademarks or trademarks of TIBCO Software Inc. in the United States and/or other countries. All other product and company names and marks mentioned in this document are the property of their respective owners and are mentioned for identification purposes only. THIS SOFTWARE MAY BE AVAILABLE ON MULTIPLE OPERATING SYSTEMS. HOWEVER, NOT ALL OPERATING SYSTEM PLATFORMS FOR A SPECIFIC SOFTWARE VERSION ARE RELEASED AT THE SAME TIME. SEE THE README.TXT FILE FOR THE AVAILABILITY OF THIS SOFTWARE VERSION ON A SPECIFIC OPERATING SYSTEM PLATFORM. THIS DOCUMENT IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THIS DOCUMENT COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED IN NEW EDITIONS OF THIS DOCUMENT. TIBCO SOFTWARE INC. MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THIS DOCUMENT AT ANY TIME. THE CONTENTS OF THIS DOCUMENT MAY BE MODIFIED AND/OR QUALIFIED, DIRECTLY OR INDIRECTLY, BY OTHER DOCUMENTATION WHICH ACCOMPANIES THIS SOFTWARE, INCLUDING BUT NOT LIMITED TO ANY RELEASE NOTES AND "READ ME" FILES. Copyright 1999-2010 TIBCO Software Inc. ALL RIGHTS RESERVED. TIBCO Software Inc. Confidential Information
| iii
Contents
Related Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi TIBCO Administrator Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi TIBCO Runtime Agent Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi Typographical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii How to Contact TIBCO Support. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix Feature Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 API Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Getting Started with the API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Compiling Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Running Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Running the Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Using the API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Common Aspects of the API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Objects and Factory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 AuthenticationSubject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 RoleMembershipConfig and RoleMembership . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 AuthUtils . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Best Practices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 General Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
iv
| Contents
|v
Preface
The TIBCO Runtime Agent Authentication API provides an API that enables users to create custom scripts and applications.
Topics
Related Documentation, page vi Typographical Conventions, page vii How to Contact TIBCO Support, page ix
vi
| Related Documentation
Related Documentation
This section lists documentation resources you may find useful.
Preface vii
Typographical Conventions
The following typographical conventions are used in this manual. Table 1 General Typographical Conventions Convention
TIBCO_HOME
Use Many TIBCO products must be installed within the same home directory. This directory is referenced in documentation as TIBCO_HOME. The value of TIBCO_HOME depends on the operating system. For example, on Windows systems, the default value is C:\tibco. TIBCO Administrator installs into a directory within TIBCO_HOME. This directory is referenced in documentation as TIBCO_TRA_HOME. The value of TIBCO_TRA_HOME depends on the operating system. For example on Windows systems, the default value is C:\tibco\tra\5.7. The version of TIBCO Runtime Agent currently installed is referenced in documentation as TIBCO_TRA_VERSION, for example, 5 . 7 . TIBCO_DOMAIN_HOME is where TIBCO domain-related files (such as logs, configuration, and startup files) are stored. If TIBCO_HOME is C : \ t i b c o , then TIBCO_DOMAIN_HOME is normally C : \ t i b c o \ t r a \ d o m a i n . For instance, if the domain name is m y d o m a i n then its domain specific files will be stored in C:\tibco\tra\domain\mydomain. TIBCO_TPCL_VERSION indicates the version number of third-party class libraries included with TIBCO Runtime Agent.
code font
Code font identifies commands, code examples, filenames, pathnames, and output displayed in a command window. For example: Use M y C o m m a n d to start the foo process.
viii
| Typographical Conventions
Table 1 General Typographical Conventions (Contd) Convention
bold code font
Use Bold code font is used in the following ways: In procedures, to indicate what a user types. For example: Type
admin.
In large code samples, to indicate the parts of the sample that are of particular interest. In command syntax, to indicate the default parameter for a command. For example, if no parameter is specified, M y C o m m a n d is enabled:
MyCommand [enable | disable]
italic font
Italic font is used in the following ways: To indicate a document title. For example: See TIBCO ActiveMatrix BusinessWorks Concepts. To introduce new terms For example: A portal page may contain several portlets. Portlets are mini-applications that run in a portal. To indicate a variable in a command or code syntax that you must replace. For example: M y C o m m a n d PathName
Key combinations
Key name separated by a plus sign indicate keys pressed simultaneously. For example: Ctrl+C. Key names separated by a comma and space indicate keys pressed one after the other. For example: Esc, Ctrl+Q. The note icon indicates information that is of special interest or importance, for example, an additional action required only in certain circumstances. The tip icon indicates an idea that could be useful, for example, a way to apply the information provided in the current section to achieve a specific result. The warning icon indicates the potential for a damaging situation, for example, data loss or corruption if certain steps are taken or not taken.
Preface ix
|1
Chapter 1
This chapter explains the need for TIBCO Runtime Agent Authentication API, and contains instructions for its use.
Topics
Feature Overview, page 2 API Overview, page 3 Getting Started with the API, page 4 Common Aspects of the API, page 6 Best Practices, page 7
| Chapter 1
Feature Overview
This is an API that can be used to create custom scripts and applications. This API includes Javadocs, viewable in a web browser.
API Overview 3
API Overview
This API can be used to create custom scripts and applications. Javadocs for this API are contained in the following directory: TIBCO_TRA_HOME/doc/auth/javadoc For explanations of the meaning of variables like TIBCO_TRA_HOME, TIBCO_DOMAIN_HOME, TIBCO_TRA_VERSION, and so on, please refer to the table on Typographical Conventions on page vii of the Preface. While most TIBCO Runtime Agent and TIBCO Runtime Agent (TRA) requirements are addressed by the capabilities available through Runtime Agent Console and other TRA utilities, this API allows you to provide programmatic access to the functionality available through Runtime Agent Console. This API provides a framework for doing the following: User authentication Retrieve users Retrieve roles and role memberships
| Chapter 1
Compiling Programs
In order to compile your scripts and applications, you will need to include the following jar files in your classpath: TIBCO_TRA_HOME/ l i b / T I B C O A u t h A P I . j a r
Running Programs
In order to run your scripts and applications, your system must meet the requirements described in this section. Note that an API program cannot be run remotely from the command-line. You must run it on a machine where this Authentication API is installed. Running Programs: Environment Variables Required To run a program or application that uses this API , you must set the following environment variables:
TIBCO_TRA_VERSION=TIBCO_TRA_VERSION TIBCO_TRA_HOME=TIBCO_TRA_HOME T I B C O _ D O M A I N _ N A M E = Your-Domain-Name TIBCO_DOMAIN_HOME=TIBCO_DOMAIN_HOME
Running Programs: JAR Files Required You must also ensure that the following JAR files are on your classpath: TRA jar files from following directory: TIBCO_TRA_HOME/ l i b These files include T I B C O A u t h A P I . j a r and T I B C O A u t h A P I i m p l . j a r HAWK Jar files from following directory: TIBCO_HOME/ h a w k / l i b
TPCL jar files from following directories: TIBCO_HOME/ t p c l / TIBCO_TPCL_VERSION/ l i b TIBCO_HOME/ t p c l / TIBCO_TPCL_VERSION/ j d b c
SampleAuthAPIUsage.java
| Chapter 1
AuthenticationSubject
An object of the AuthenticationSubject class represents an authenticated user, and contains such information as the user name, password, and whether or not the user is authenticated. This is not used for validating the authentication for the username and password specified here. This is only used for such purposes as identifying the user or checking role memberships for a user. For information on checking authorization, refer to AuthUtils on page 6.
AuthUtils
The model objects such as User and Role are purely data objects with no behavior exposed. This utility class exposes the behavior for these objects. For example, it provides role membership, taking into account the membership inherited from child roles. The single instance of this utility class is obtained by calling i n s t a n c e ( ) .
TIBCO Runtime Agent Authentication API Users Guide
Best Practices 7
Best Practices
General Tips
The following sections provide some general tips for developers. Log Files When a program written using these API does not behave as expected, make sure you check the TIBCO_DOMAIN_HOME\ TIBCO_DOMAIN_NAME\ l o g s \ A d m i n i s t r a t o r . l o g file. It may indicate what exceptions or errors have been encountered.
| Chapter 1
|9
Index
A
API Overview 3
U
Using the API 5
C
Compiling Programs 4 customer support ix
G
Getting Started with the API 4
R
Running Programs 4 Running the Samples 5
S
support, contacting ix
T
technical support ix TIBCO_HOME vii