Picketlink Picketlink Reference Documentation
Total Page:16
File Type:pdf, Size:1020Kb
PicketLink PicketLink Reference Documentation PicketLink PicketLink Reference Documentation PicketLink PicketLink Reference Documentation PicketLink Author Copyright © 2014 Red Hat. The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version. Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law. Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, MetaMatrix, Fedora, the Infinity Logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries. Linux® is the registered trademark of Linus Torvalds in the United States and other countries. Java® is a registered trademark of Oracle and/or its affiliates. XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries. MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries. Node.js® is an official trademark of Joyent. Red Hat Software Collections is not formally related to or endorsed by the official Joyent Node.js open source or commercial project. The OpenStack® Word Mark and OpenStack Logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community. All other trademarks are the property of their respective owners. PicketLink is an umbrella project for security and identity management for Java Applications. PicketLink is an important project under the security offerings from JBoss. Preface ix 1. Document Conventions ................................................................................................... ix 1.1. Typographic Conventions ...................................................................................... ix 1.2. Pull-quote Conventions .......................................................................................... x 1.3. Notes and Warnings ............................................................................................. xi 2. Getting Help and Giving Feedback .................................................................................. xi 2.1. Do You Need Help? ............................................................................................. xi 1. Overview 1 1.1. The Top 8 Java Application Security Problems Solved by PicketLink ................................ 1 1.2. What is PicketLink? ...................................................................................................... 2 1.3. Where do I get started? ................................................................................................ 4 1.3.1. QuickStarts ........................................................................................................ 5 1.3.2. API Documentation ............................................................................................ 5 1.4. Modules ....................................................................................................................... 5 1.4.1. Base module ...................................................................................................... 5 1.4.2. Identity Management .......................................................................................... 6 1.4.3. Authorization Module .......................................................................................... 6 1.4.4. JSON ................................................................................................................ 7 1.4.5. Federation ......................................................................................................... 7 1.5. License ......................................................................................................................... 7 1.6. Maven Dependencies .................................................................................................... 7 1.7. PicketLink Installer ...................................................................................................... 10 1.8. Referencing PicketLink from JBoss Modules ................................................................ 11 1.9. Help us improve the docs! ........................................................................................... 12 2. Authentication 13 2.1. Overview .................................................................................................................... 13 2.2. Authentication API - The Identity Bean ......................................................................... 13 2.2.1. Stateful or Stateless Authentication ................................................................... 16 2.2.2. Defining a Custom Scope ................................................................................. 16 2.3. The Authentication Process ......................................................................................... 17 2.3.1. A Basic Authenticator ....................................................................................... 19 2.3.2. Multiple Authenticator Support .......................................................................... 20 2.3.3. Credentials ....................................................................................................... 21 2.3.4. DefaultLoginCredentials .................................................................................... 22 2.4. Events ........................................................................................................................ 24 3. Identity Management - Overview 25 3.1. Introduction ................................................................................................................. 25 3.1.1. Injecting the Identity Management Objects ......................................................... 27 3.1.2. Interacting with PicketLink IDM During Application Startup .................................. 27 3.1.3. Configuring the Default Partition ........................................................................ 28 3.2. Getting Started - The 5 Minute Guide .......................................................................... 28 3.3. Identity Model ............................................................................................................. 29 3.3.1. Which Identity Model Should My Application Use? ............................................. 31 3.4. Stereotypes ................................................................................................................ 31 3.4.1. Identity Stereotypes .......................................................................................... 32 3.4.2. Relationship Stereotypes .................................................................................. 33 3.5. Creating a Custom Identity Model ................................................................................ 34 3.5.1. The @AttributeProperty Annotation ............................................................ 36 3.5.2. The @Unique Annotation ................................................................................. 36 3.5.3. The @InheritsPrivileges Annotation .......................................................... 36 3.6. Creating Custom Relationships .................................................................................... 37 3.7. Partition Management ................................................................................................. 38 iii PicketLink Reference Documentation 3.7.1. Creating Custom Partitions ............................................................................... 40 4. Identity Management - Credential Validation and Management 41 4.1. Authentication ............................................................................................................. 41 4.2. Managing Credentials .................................................................................................. 43 4.3. Credential Handlers ..................................................................................................... 44 4.3.1. The CredentialStore interface ..................................................................... 46 4.3.2. The CredentialStorage interface ................................................................. 47 4.4. Built-in Credential Handlers ......................................................................................... 48 4.4.1. Username/Password-based Credential Handler .................................................. 49 4.4.2. DIGEST-based Credential Handler .................................................................... 50 4.4.3. X509-based Credential Handler ........................................................................ 51 4.4.4. Time-based One Time Password Credential Handler .......................................... 52 4.5. Implementing a Custom CredentialHandler ............................................................ 53 4.6. Validating Credentials for Custom Account Types ........................................................