Source Code Cross Referenced for UserRealm.java in  » Sevlet-Container » jetty-modules » org » mortbay » jetty » security » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Sevlet Container » jetty modules » org.mortbay.jetty.security 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // ========================================================================
002:        // Copyright 1996-2005 Mort Bay Consulting Pty. Ltd.
003:        // ------------------------------------------------------------------------
004:        // Licensed under the Apache License, Version 2.0 (the "License");
005:        // you may not use this file except in compliance with the License.
006:        // You may obtain a copy of the License at 
007:        // http://www.apache.org/licenses/LICENSE-2.0
008:        // Unless required by applicable law or agreed to in writing, software
009:        // distributed under the License is distributed on an "AS IS" BASIS,
010:        // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
011:        // See the License for the specific language governing permissions and
012:        // limitations under the License.
013:        // ========================================================================
014:
015:        package org.mortbay.jetty.security;
016:
017:        import java.security.Principal;
018:
019:        import org.mortbay.jetty.Request;
020:
021:        /* ------------------------------------------------------------ */
022:        /** User Realm.
023:         *
024:         * This interface should be specialized to provide specific user
025:         * lookup and authentication using arbitrary methods.
026:         *
027:         * For SSO implementation sof UserRealm should also implement SSORealm.
028:         *
029:         * 
030:         * @see SSORealm
031:         * @author Greg Wilkins (gregw)
032:         */
033:        public interface UserRealm {
034:            /* ------------------------------------------------------------ */
035:            public String getName();
036:
037:            /* ------------------------------------------------------------ */
038:            /** Get the principal for a username.
039:             * This method is not guaranteed to return a Principal for non-authenticated users.
040:             */
041:            public Principal getPrincipal(String username);
042:
043:            /* ------------------------------------------------------------ */
044:            /** Authenticate a users credentials.
045:             * Implementations of this method may adorn the calling context to
046:             * assoicate it with the authenticated principal (eg ThreadLocals). If
047:             * such context associations are made, they should be considered valid
048:             * until a UserRealm.deAuthenticate(UserPrincipal) call is made for this
049:             * UserPrincipal.
050:             * @param username The username. 
051:             * @param credentials The user credentials, normally a String password. 
052:             * @param request The request to be authenticated. Additional
053:             * parameters may be extracted or set on this request as needed
054:             * for the authentication mechanism (none required for BASIC and
055:             * FORM authentication).
056:             * @return The authenticated UserPrincipal.
057:             */
058:            public Principal authenticate(String username, Object credentials,
059:                    Request request);
060:
061:            /* ------------------------------------------------------------ */
062:            /** Re Authenticate a Principal.
063:             * Authenicate a principal that has previously been return from the authenticate method.
064:             * 
065:             * Implementations of this method may adorn the calling context to
066:             * assoicate it with the authenticated principal (eg ThreadLocals). If
067:             * such context associations are made, they should be considered valid
068:             * until a UserRealm.deAuthenticate(UserPrincipal) call is made for this
069:             * UserPrincipal.
070:             *
071:             * @return True if this user is still authenticated.
072:             */
073:            public boolean reauthenticate(Principal user);
074:
075:            /* ------------------------------------------------------------ */
076:            /** Check if the user is in a role. 
077:             * @param role A role name.
078:             * @return True if the user can act in that role.
079:             */
080:            public boolean isUserInRole(Principal user, String role);
081:
082:            /* ------------------------------------------------------------ */
083:            /** Dissassociate the calling context with a Principal.
084:             * This method is called when the calling context is not longer
085:             * associated with the Principal.  It should be used by an implementation
086:             * to remove context associations such as ThreadLocals.
087:             * The UserPrincipal object remains authenticated, as it may be
088:             * associated with other contexts.
089:             * @param user A UserPrincipal allocated from this realm.
090:             */
091:            public void disassociate(Principal user);
092:
093:            /* ------------------------------------------------------------ */
094:            /** Push role onto a Principal.
095:             * This method is used to add a role to an existing principal.
096:             * @param user An existing UserPrincipal or null for an anonymous user.
097:             * @param role The role to add.
098:             * @return A new UserPrincipal object that wraps the passed user, but
099:             * with the added role.
100:             */
101:            public Principal pushRole(Principal user, String role);
102:
103:            /* ------------------------------------------------------------ */
104:            /** Pop role from a Principal.
105:             * @param user A UserPrincipal previously returned from pushRole
106:             * @return The principal without the role.  Most often this will be the
107:             * original UserPrincipal passed.
108:             */
109:            public Principal popRole(Principal user);
110:
111:            /* ------------------------------------------------------------ */
112:            /** logout a user Principal.
113:             * Called by authentication mechanisms (eg FORM) that can detect logout.
114:             * @param user A Principal previously returned from this realm
115:             */
116:            public void logout(Principal user);
117:
118:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.