Broadcast on Broadcast off
The Documentation for Project Zero has moved. Please update your bookmarks to: http://www.projectzero.org/documentation/
Table of
Contents...
Hide

Project Zero Developer’s Guide

Concepts and components
Basic concepts overview
Event processing
Writing Java handlers
Writing Groovy handlers
Firing events
Global Context
Global Context reference
Application directory layout
Virtualized directories
Assemble
PHP
Features and configuration
Configuration
Debugging
Dependencies
Packaging
Application classpath
Logging and tracing
RESTful resources
RESTful documentation
File serving
Response rendering
Validators and validation
HTTP error handling
Calling a remote resource
Using the Connection API
Sending an email using EmailConnection
Configuring destinations
Configuring protocols
Configuring connection handlers
Creating a connection handler
Creating a custom protocol transport
Simple logging connection handlers
Protocol reference
Client programming with Dojo
Runtime options
Deployment modifications
HTTP configuration
SSL configuration
Proxy configuration
Extending the CLI
Security considerations
Authentication
OpenID authentication
Extending security
Security tokens
CSRF prevention support
Extending token support
Leveraging TAI
User service
File based user service
LDAP user service
Extending user service
Security Utilities
Leveraging XOREncoder
Extensions
Atom support
RSS support
JSON support
XMLEncoder
REST to SOAP extension
URIUtils
Developer Web tools
Database setup tools
Configuring data access
Common query patterns
Advanced query patterns
Update patterns
Local database transactions
Extending data access
Configuration vendor differences
PHP data access
Resource model
Configuring ZRM
Resource model declaration
Programmatic model API
HTTP REST API
A ZRM mini tutorial
Active content filtering support
Default filters
Custom filters
Runtime management
Management commands
Zero socket opener
Other extension modules
Amazon E-commerce service
Flickr service
WeatherZero forecast service
Wikipedia service
Reference
Zero command line interface
JavaDoc - Public API
JavaDoc - Public SPI
JavaDoc - All Classes

 

Extending token support

Project Zero's authentication provides a pluggable token handling framework to support custom token implementations. The following sections of this article describe how token support can be extended:

Token and TokenFactory interfaces

To implement a custom token, first create instances of the Token and TokenFactory interfaces. For more information on each, see the following information:

Token
zero.core.security.token.Token

TokenFactory
zero.core.security.token.TokenFactory

Implement a token service handler

For each of the following event names, implement a handler:

<tokenType>Attach
Creates a new token
<tokenType>Validate
Validates a token
<tokenType>Logout
Handles the logout of a user

The details of the <tokenType> token are described in the following section. You can register the handler in your library or in the application's zero.config file as a handler for those events. For example, if your tokenType is customToken, you would implement a handler with the following methods:

onCustomTokenAttach
Creates a new CustomToken token
onCustomTokenValidate
Validates a CustomToken token
onCustomTokenLogout
Handle logout processing

The following example shows the settings for configuring a custom token named CustomToken in the application or library zero.config file:

/config/security/token/tokenType="customToken"
/config/handlers += [{
        "events" : ["customTokenAttach", "customTokenValidate", 
                       "customTokenLogout"],
        "handler" : "custom.CustomTokenService.class"
}]

The token type must be set in the GlobalContext at /config/security/token/tokenType.

r9 - 29 Jan 2008 - 18:19:39 - todkap
Syndicate this site RSS ATOM
Copyright 2007 © IBM Corporation | Privacy | Terms of Use | About this site