oltu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1524319 - in /oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller: AuthzController.java MainController.java
Date Wed, 18 Sep 2013 07:44:55 GMT
Author: simonetripodi
Date: Wed Sep 18 07:44:54 2013
New Revision: 1524319

URL: http://svn.apache.org/r1524319
Log:
trivial: code format

Modified:
    oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/AuthzController.java
    oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/MainController.java

Modified: oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/AuthzController.java
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/AuthzController.java?rev=1524319&r1=1524318&r2=1524319&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/AuthzController.java
(original)
+++ oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/AuthzController.java
Wed Sep 18 07:44:54 2013
@@ -18,10 +18,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.oltu.oauth2.client.demo.controller;
 
-
 import java.io.IOException;
 import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
@@ -44,13 +42,11 @@ import org.apache.oltu.oauth2.common.mes
 
 /**
  * Handles requests for the application welcome page.
- *
  */
 @Controller
 @RequestMapping("/")
 public class AuthzController {
 
-
     private Logger logger = LoggerFactory.getLogger(AuthzController.class);
 
     @RequestMapping("/authorize")
@@ -60,7 +56,6 @@ public class AuthzController {
         throws OAuthSystemException, IOException {
 
         try {
-
             Utils.validateAuthorizationParams(oauthParams);
 
             res.addCookie(new Cookie("clientId", oauthParams.getClientId()));
@@ -82,12 +77,10 @@ public class AuthzController {
                 .buildQueryMessage();
 
             return new ModelAndView(new RedirectView(request.getLocationUri()));
-
         } catch (ApplicationException e) {
             oauthParams.setErrorMessage(e.getMessage());
             return new ModelAndView("get_authz");
         }
     }
 
-
 }

Modified: oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/MainController.java
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/MainController.java?rev=1524319&r1=1524318&r2=1524319&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/MainController.java
(original)
+++ oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/MainController.java
Wed Sep 18 07:44:54 2013
@@ -18,7 +18,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.oltu.oauth2.client.demo.controller;
 
 import java.io.IOException;
@@ -40,11 +39,7 @@ import org.springframework.web.bind.anno
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.servlet.ModelAndView;
 
-
 /**
- *
- *
- *
  */
 @Controller
 @RequestMapping("/")
@@ -72,7 +67,7 @@ public class MainController {
         boolean selected = false;
         if (Utils.GENERIC.equalsIgnoreCase(app)) {
             selected = true;
-        }else if (Utils.GITHUB.equalsIgnoreCase(app)) {
+        } else if (Utils.GITHUB.equalsIgnoreCase(app)) {
             selected = true;
             oauthParams.setAuthzEndpoint(Utils.GITHUB_AUTHZ);
             oauthParams.setTokenEndpoint(Utils.GITHUB_TOKEN);
@@ -81,7 +76,7 @@ public class MainController {
             selected = true;
             oauthParams.setAuthzEndpoint(Utils.FACEBOOK_AUTHZ);
             oauthParams.setTokenEndpoint(Utils.FACEBOOK_TOKEN);
-        }else if (Utils.GOOGLE.equalsIgnoreCase(app)) {
+        } else if (Utils.GOOGLE.equalsIgnoreCase(app)) {
                 selected = true;
                 oauthParams.setAuthzEndpoint(Utils.GOOGLE_AUTHZ);
                 oauthParams.setTokenEndpoint(Utils.GOOGLE_TOKEN);
@@ -109,19 +104,17 @@ public class MainController {
 
     @RequestMapping("/decode")
     public ModelAndView decode(@ModelAttribute("oauthParams") OAuthParams oauthParams){
+        try {
+            JWT jwt = jwtReader.read(oauthParams.getJwt());
 
-    	try{
-    		JWT jwt = jwtReader.read(oauthParams.getJwt());
-
-    		oauthParams.setHeader(jwtWriter.write(jwt.getHeader()));
-    		oauthParams.setClaimsSet(jwtWriter.write(jwt.getClaimsSet()));
-    	} catch (Exception e){
-    		oauthParams.setErrorMessage(
+            oauthParams.setHeader(jwtWriter.write(jwt.getHeader()));
+            oauthParams.setClaimsSet(jwtWriter.write(jwt.getClaimsSet()));
+        } catch (Exception e){
+            oauthParams.setErrorMessage(
                     "Error while decoding the token: " + e);
-    	}
-
-    	return new ModelAndView("index");
-	}
+        }
 
+        return new ModelAndView("index");
+    }
 
 }



Mime
View raw message