Author: prabath
Date: Thu Feb 21 21:24:19 2008
New Revision: 14017

Log:

code formatting + comments

Modified:
   
trunk/solutions/identity/modules/token-verifier-core/src/main/java/org/wso2/solutions/identity/relyingparty/openid/OpenIDAxAttribute.java
   
trunk/solutions/identity/modules/token-verifier-core/src/main/java/org/wso2/solutions/identity/relyingparty/openid/OpenIDConsumer.java

Modified: 
trunk/solutions/identity/modules/token-verifier-core/src/main/java/org/wso2/solutions/identity/relyingparty/openid/OpenIDAxAttribute.java
==============================================================================
--- 
trunk/solutions/identity/modules/token-verifier-core/src/main/java/org/wso2/solutions/identity/relyingparty/openid/OpenIDAxAttribute.java
   (original)
+++ 
trunk/solutions/identity/modules/token-verifier-core/src/main/java/org/wso2/solutions/identity/relyingparty/openid/OpenIDAxAttribute.java
   Thu Feb 21 21:24:19 2008
@@ -6,8 +6,8 @@
     private String namespace;
 
     /**
-     * @param attributeName
-     * @param namespace
+     * @param attributeName Name of the attribute - alias
+     * @param namespace Namespace url corresponding to the provided attribute
      */
     public OpenIDAxAttribute(String attributeName, String namespace) {
         this.attributeName = attributeName;

Modified: 
trunk/solutions/identity/modules/token-verifier-core/src/main/java/org/wso2/solutions/identity/relyingparty/openid/OpenIDConsumer.java
==============================================================================
--- 
trunk/solutions/identity/modules/token-verifier-core/src/main/java/org/wso2/solutions/identity/relyingparty/openid/OpenIDConsumer.java
      (original)
+++ 
trunk/solutions/identity/modules/token-verifier-core/src/main/java/org/wso2/solutions/identity/relyingparty/openid/OpenIDConsumer.java
      Thu Feb 21 21:24:19 2008
@@ -38,8 +38,8 @@
     private static OpenIDConsumer consumer;
 
     /**
-     * 
-     * @throws Exception
+     * Creates an instance of OpenIDConsumer
+     * @throws RelyingPartyException
      */
     private OpenIDConsumer() throws RelyingPartyException {
 
@@ -60,9 +60,8 @@
     }
 
     /**
-     * 
-     * @return
-     * @throws Exception
+     * @return An instance of OpenIDConsumer
+     * @throws RelyingPartyException
      */
     public static OpenIDConsumer getInstance() throws RelyingPartyException {
 
@@ -73,15 +72,11 @@
     }
 
     /**
-     * 
-     * @param userSuppliedString
-     * @param returnToUrl
-     * @param httpReq
-     * @param httpResp
-     * @return
-     * @throws IOException
+     * Authenticates the OpenID url.
+     * @param request OpenID authentication request.
+     * @throws RelyingPartyException
      */
-    protected String authRequest(OpenIDAuthenticationRequest request)
+    protected void authRequest(OpenIDAuthenticationRequest request)
             throws RelyingPartyException {
 
         List discoveries = null;
@@ -130,15 +125,16 @@
 
                 if (request.getRequiredClaims() != null
                         && request.getRequiredClaims().size() > 0) {
-                    
-                    OpenIDAxAttribute attr = null; 
-                    
+
+                    OpenIDAxAttribute attr = null;
+
                     for (Object requiredClaim : request.getRequiredClaims()) {
-                        attr = (OpenIDAxAttribute)requiredClaim;
-                        fetchReq.addAttribute(attr.getAttributeName(), 
attr.getNamespace(), true);
+                        attr = (OpenIDAxAttribute) requiredClaim;
+                        fetchReq.addAttribute(attr.getAttributeName(), attr
+                                .getNamespace(), true);
                     }
-                } 
-                
+                }
+
                 authReq.addExtension(fetchReq);
             }
 
@@ -155,13 +151,11 @@
             throw new RelyingPartyException(
                     IdentityConstants.ErrorCodes.INVALID_OPENID, e);
         }
-
-        return null;
     }
 
     /**
-     * 
-     * @param request
+     * Populates session attributes.
+     * @param request HttpServletRequest
      */
     public void setSessionAttributes(HttpServletRequest request)
             throws RelyingPartyException {
@@ -242,8 +236,8 @@
     }
 
     /**
-     * 
-     * @param request
+     * Authenticates the OpenID url.
+     * @param request OpenID authentication request.
      */
     public void doOpenIDAuthentication(OpenIDAuthenticationRequest request)
             throws RelyingPartyException {
@@ -260,10 +254,9 @@
     }
 
     /**
-     * 
-     * @param request
-     * @throws InfocardException
-     * @throws OpenIDException
+     * Populates session attributes
+     * @param request HttpServletRequest
+     * @throws RelyingPartyException
      */
     public void setInfocardSessionAttributes(HttpServletRequest request)
             throws RelyingPartyException {
@@ -293,9 +286,10 @@
     }
 
     /**
-     * 
-     * @param xmlToken
-     * @return
+     * Validates whether the given XMLToken corresponding to an OpenID
+     * information card.
+     * @param xmlToken OpenIDToken
+     * @return true is validated as an OpenID information card, else false.
      */
     public static boolean isOpenIDInfoCardToken(String xmlToken) {
         try {
@@ -311,9 +305,10 @@
     }
 
     /**
-     * 
-     * @param request
-     * @return
+     * Validates whether the provided request is an OpenID authentication
+     * request.
+     * @param request HttpServletRequest
+     * @return true is validated as an OpenID authentication, else false.
      */
     public static boolean isOpenIDAuthetication(HttpServletRequest request) {
 
@@ -349,11 +344,12 @@
     }
 
     /**
-     * 
-     * @param request
-     * @param session
-     * @param openidResp
+     * Parses OpenID response.
+     * @param request HttpServletRequest
+     * @param session HttpSession
+     * @param openidResp OpenID response
      * @throws OpenIDException
+     * @throws RelyingPartyException
      */
     protected void processOpenIDResp(HttpServletRequest request,
             HttpSession session, ParameterList openidResp)
@@ -418,14 +414,13 @@
                 regResponse = (SRegResponse) extension;
                 setRequestAttributes(regResponse, request);
             }
-
         }
     }
 
     /**
-     * 
-     * @param request
-     * @return
+     * Extract parameters from the OpenID information card
+     * @param request HttpServletRequest
+     * @return Extracted a parameter list
      * @throws InfocardException
      */
     private ParameterList extractFromInfocardPost(HttpServletRequest request)
@@ -450,8 +445,9 @@
     }
 
     /**
-     * 
-     * @param request
+     * If no attribute set by the use for simple registration request, by
+     * default we set all the attributes.
+     * @param request Simple registration request
      */
     private void setDefaultRequestParams(SRegRequest request) {
         request.addAttribute(
@@ -475,9 +471,9 @@
     }
 
     /**
-     * 
-     * @param response
-     * @param request
+     * Set request attributes for OpenID attribute exchange
+     * @param response FetchResponse
+     * @param request HttpServletRequest
      */
     private void setRequestAttributes(FetchResponse response,
             HttpServletRequest request) {
@@ -496,9 +492,9 @@
     }
 
     /**
-     * 
-     * @param response
-     * @param request
+     * Set request attributes for OpenID simple registration
+     * @param response FetchResponse
+     * @param request HttpServletRequest
      */
     private void setRequestAttributes(SRegResponse response,
             HttpServletRequest request) {

_______________________________________________
Identity-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/identity-dev

Reply via email to