oltu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asa...@apache.org
Subject svn commit: r1531867 - /oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/RedirectController.java
Date Mon, 14 Oct 2013 12:05:34 GMT
Author: asanso
Date: Mon Oct 14 12:05:34 2013
New Revision: 1531867

URL: http://svn.apache.org/r1531867
Log:
OLTU-122 - Broken Authorization Endpoint error page

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

Modified: oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/RedirectController.java
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/RedirectController.java?rev=1531867&r1=1531866&r2=1531867&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/RedirectController.java
(original)
+++ oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/RedirectController.java
Mon Oct 14 12:05:34 2013
@@ -51,15 +51,7 @@ public class RedirectController {
 
 
         try {
-
-            // Create the response wrapper
-            OAuthAuthzResponse oar = null;
-            oar = OAuthAuthzResponse.oauthCodeAuthzResponse(request);
-
-
-            // Get Authorization Code
-            String code = oar.getCode();
-
+        	
             // Get OAuth Info
             String clientId = Utils.findCookieValue(request, "clientId");
             String clientSecret = Utils.findCookieValue(request, "clientSecret");
@@ -69,10 +61,6 @@ public class RedirectController {
             String scope = Utils.findCookieValue(request, "scope");
             String state = Utils.findCookieValue(request, "state");
 
-            String app = Utils.findCookieValue(request, "app");
-            response.addCookie(new Cookie("app", app));
-
-            oauthParams.setAuthzCode(code);
             oauthParams.setClientId(clientId);
             oauthParams.setClientSecret(clientSecret);
             oauthParams.setAuthzEndpoint(authzEndpoint);
@@ -80,8 +68,19 @@ public class RedirectController {
             oauthParams.setRedirectUri(redirectUri);
             oauthParams.setScope(Utils.isIssued(scope));
             oauthParams.setState(Utils.isIssued(state));
-            oauthParams.setApplication(app);
+            
+            // Create the response wrapper
+            OAuthAuthzResponse oar = null;
+            oar = OAuthAuthzResponse.oauthCodeAuthzResponse(request);
+
+            // Get Authorization Code
+            String code = oar.getCode();
+            oauthParams.setAuthzCode(code);
+
+            String app = Utils.findCookieValue(request, "app");
+            response.addCookie(new Cookie("app", app));
 
+            oauthParams.setApplication(app);
 
         } catch (OAuthProblemException e) {
             StringBuffer sb = new StringBuffer();
@@ -91,7 +90,7 @@ public class RedirectController {
             sb.append("Error uri: ").append(e.getUri()).append("</br>");
             sb.append("State: ").append(e.getState()).append("</br>");
             oauthParams.setErrorMessage(sb.toString());
-            return new ModelAndView("main");
+            return new ModelAndView("get_authz");
         }
 
         return new ModelAndView("request_token");



Mime
View raw message