Java Doc for AuthenticationManager.java in  » Content-Management-System » dspace » org » dspace » authenticate » 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 » Content Management System » dspace » org.dspace.authenticate 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.dspace.authenticate.AuthenticationManager

AuthenticationManager
public class AuthenticationManager (Code)
Access point for the stackable authentication methods.

This class initializes the "stack" from the DSpace configuration, and then invokes methods in the appropriate order on behalf of clients.

See the AuthenticationMethod interface for details about what each function does.

Configuration
The stack of authentication methods is defined by one property in the DSpace configuration:

 plugin.sequence.org.dspace.eperson.AuthenticationMethod = a list of method class names
 e.g.
 plugin.sequence.org.dspace.eperson.AuthenticationMethod = \
 org.dspace.eperson.X509Authentication, \
 org.dspace.eperson.PasswordAuthentication
 

The "stack" is always traversed in order, with the methods specified first (in the configuration) thus getting highest priority.
See Also:   AuthenticationMethod
author:
   Larry Stone
version:
   $Revision: 2168 $





Method Summary
public static  booleanallowSetPassword(Context context, HttpServletRequest request, String username)
     Predicate, can user set EPerson password. Returns true if the allowSetPassword() method of any member of the stack returns true.
Parameters:
  context - DSpace context
Parameters:
  request - HTTP request, in case it's needed.
public static  intauthenticate(Context context, String username, String password, String realm, HttpServletRequest request)
     Test credentials for authenticity. Apply the given credentials to each authenticate() method in the stack.
public static  intauthenticateImplicit(Context context, String username, String password, String realm, HttpServletRequest request)
     Test credentials for authenticity, using only Implicit methods. Just like authenticate(), except it only invokes the implicit authentication methods the stack.
Parameters:
  context - DSpace context, will be modified (ePerson set) upon success.
Parameters:
  username - Username (or email address) when method is explicit.
public static  IteratorauthenticationMethodIterator()
     Get stack of authentication methods.
public static  booleancanSelfRegister(Context context, HttpServletRequest request, String username)
     Predicate, can a new EPerson be created. Invokes canSelfRegister() of every authentication method in the stack, and returns true if any of them is true.
Parameters:
  context - DSpace context
Parameters:
  request - HTTP request, in case it's needed.
public static  int[]getSpecialGroups(Context context, HttpServletRequest request)
     Get list of extra groups that user implicitly belongs to. Returns accumulation of groups of all the getSpecialGroups() methods in the stack.
Parameters:
  context - A valid DSpace context.
Parameters:
  request - The request that started this operation, or null if not applicable.
public static  voidinitEPerson(Context context, HttpServletRequest request, EPerson eperson)
     Initialize a new e-person record for a self-registered new user. Give every authentication method in the stack a chance to initialize the new ePerson by calling its initEperson()
Parameters:
  context - DSpace context
Parameters:
  request - HTTP request, in case it's needed.



Method Detail
allowSetPassword
public static boolean allowSetPassword(Context context, HttpServletRequest request, String username) throws SQLException(Code)
Predicate, can user set EPerson password. Returns true if the allowSetPassword() method of any member of the stack returns true.
Parameters:
  context - DSpace context
Parameters:
  request - HTTP request, in case it's needed. Can be null.
Parameters:
  username - Username, if available. Can be null. true if this method allows user to change ePerson password.



authenticate
public static int authenticate(Context context, String username, String password, String realm, HttpServletRequest request)(Code)
Test credentials for authenticity. Apply the given credentials to each authenticate() method in the stack. Returns upon the first SUCCESS, or otherwise returns the most favorable outcome from one of the methods.
Parameters:
  context - DSpace context, will be modified (ePerson set) upon success.
Parameters:
  username - Username (or email address) when method is explicit. Use null forimplicit method.
Parameters:
  password - Password for explicit auth, or null for implicit method.
Parameters:
  realm - Realm is an extra parameter used by some authentication methods, leave null ifnot applicable.
Parameters:
  request - The HTTP request that started this operation, or null if not applicable. One of:SUCCESS, BAD_CREDENTIALS, CERT_REQUIRED, NO_SUCH_USER, BAD_ARGS

Meaning:
SUCCESS - authenticated OK.
BAD_CREDENTIALS - user exists, but credenitals (e.g. passwd) don't match
CERT_REQUIRED - not allowed to login this way without X.509 cert.
NO_SUCH_USER - user not found using this method.
BAD_ARGS - user/pw not appropriate for this method




authenticateImplicit
public static int authenticateImplicit(Context context, String username, String password, String realm, HttpServletRequest request)(Code)
Test credentials for authenticity, using only Implicit methods. Just like authenticate(), except it only invokes the implicit authentication methods the stack.
Parameters:
  context - DSpace context, will be modified (ePerson set) upon success.
Parameters:
  username - Username (or email address) when method is explicit. Use null forimplicit method.
Parameters:
  password - Password for explicit auth, or null for implicit method.
Parameters:
  realm - Realm is an extra parameter used by some authentication methods, leave null ifnot applicable.
Parameters:
  request - The HTTP request that started this operation, or null if not applicable. One of:SUCCESS, BAD_CREDENTIALS, CERT_REQUIRED, NO_SUCH_USER, BAD_ARGS

Meaning:
SUCCESS - authenticated OK.
BAD_CREDENTIALS - user exists, but credenitals (e.g. passwd) don't match
CERT_REQUIRED - not allowed to login this way without X.509 cert.
NO_SUCH_USER - user not found using this method.
BAD_ARGS - user/pw not appropriate for this method




authenticationMethodIterator
public static Iterator authenticationMethodIterator()(Code)
Get stack of authentication methods. Return an Iterator that steps through each configured authentication method, in order of precedence. Iterator object.



canSelfRegister
public static boolean canSelfRegister(Context context, HttpServletRequest request, String username) throws SQLException(Code)
Predicate, can a new EPerson be created. Invokes canSelfRegister() of every authentication method in the stack, and returns true if any of them is true.
Parameters:
  context - DSpace context
Parameters:
  request - HTTP request, in case it's needed. Can be null.
Parameters:
  username - Username, if available. Can be null. true if new ePerson should be created.



getSpecialGroups
public static int[] getSpecialGroups(Context context, HttpServletRequest request) throws SQLException(Code)
Get list of extra groups that user implicitly belongs to. Returns accumulation of groups of all the getSpecialGroups() methods in the stack.
Parameters:
  context - A valid DSpace context.
Parameters:
  request - The request that started this operation, or null if not applicable. Returns IDs of any groups the user authenticated by thisrequest is in implicitly -- checks for e.g. network-address dependentgroups.



initEPerson
public static void initEPerson(Context context, HttpServletRequest request, EPerson eperson) throws SQLException(Code)
Initialize a new e-person record for a self-registered new user. Give every authentication method in the stack a chance to initialize the new ePerson by calling its initEperson()
Parameters:
  context - DSpace context
Parameters:
  request - HTTP request, in case it's needed. Can be null.
Parameters:
  eperson - newly created EPerson record - email + information from theregistration form will have been filled out.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.