oltu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asa...@apache.org
Subject svn commit: r1759596 - in /oltu/trunk/demos/client-demo/src/main: java/org/apache/oltu/oauth2/client/demo/Utils.java java/org/apache/oltu/oauth2/client/demo/controller/MainController.java webapp/WEB-INF/views/index.jsp
Date Wed, 07 Sep 2016 11:59:41 GMT
Author: asanso
Date: Wed Sep  7 11:59:41 2016
New Revision: 1759596

URL: http://svn.apache.org/viewvc?rev=1759596&view=rev
Log:
OLTU-203 - Extend client demo with more provider

Modified:
    oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/Utils.java
    oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/MainController.java
    oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/index.jsp

Modified: oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/Utils.java
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/Utils.java?rev=1759596&r1=1759595&r2=1759596&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/Utils.java
(original)
+++ oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/Utils.java
Wed Sep  7 11:59:41 2016
@@ -85,7 +85,13 @@ public final class Utils {
     public static final String MICROSOFT_AUTHZ = OAuthProviderType.MICROSOFT.getAuthzEndpoint();
     public static final String MICROSOFT_TOKEN = OAuthProviderType.MICROSOFT.getTokenEndpoint();
     public static final String MICROSOFT_SCOPE = "";
-    public static final String MICROSOFT_RESOURCE_URL = "https://api.github.com/user";
+    public static final String MICROSOFT_RESOURCE_URL = "";
+    
+    public static final String INSTAGRAM = OAuthProviderType.INSTAGRAM.getProviderName();
+    public static final String INSTAGRAM_AUTHZ = OAuthProviderType.INSTAGRAM.getAuthzEndpoint();
+    public static final String INSTAGRAM_TOKEN = OAuthProviderType.INSTAGRAM.getTokenEndpoint();
+    public static final String INSTAGRAM_SCOPE = "";
+    public static final String INSTAGRAM_RESOURCE_URL = "";
 
     public static final String SMART_GALLERY = "smart_gallery";
     public static final String SMART_GALLERY_AUTHZ = "http://localhost:8090/oauth/authorize";

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=1759596&r1=1759595&r2=1759596&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  7 11:59:41 2016
@@ -83,9 +83,12 @@ public class MainController {
         } else if (Utils.LINKEDIN.equalsIgnoreCase(app)) {
             selected = true;
             addLinkedInParams(oauthParams);
-        }  else if (Utils.MICROSOFT.equalsIgnoreCase(app)) {
+        } else if (Utils.MICROSOFT.equalsIgnoreCase(app)) {
             selected = true;
             addMicrosfotParams(oauthParams);
+        } else if (Utils.INSTAGRAM.equalsIgnoreCase(app)) {
+            selected = true;
+            addInstagramParams(oauthParams);
         }
 
         if (selected) {
@@ -134,6 +137,12 @@ public class MainController {
         oauthParams.setTokenEndpoint(Utils.MICROSOFT_TOKEN);
         oauthParams.setScope(Utils.MICROSOFT_SCOPE);
     }
+    
+    private void addInstagramParams(OAuthParams oauthParams) {
+        oauthParams.setAuthzEndpoint(Utils.INSTAGRAM_AUTHZ);
+        oauthParams.setTokenEndpoint(Utils.INSTAGRAM_AUTHZ);
+        oauthParams.setScope(Utils.INSTAGRAM_SCOPE);
+    }
 
     @RequestMapping("/decode")
     public ModelAndView decode(@ModelAttribute("oauthParams") OAuthParams oauthParams) {

Modified: oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/index.jsp
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/index.jsp?rev=1759596&r1=1759595&r2=1759596&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/index.jsp (original)
+++ oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/index.jsp Wed Sep  7 11:59:41
2016
@@ -48,6 +48,7 @@
             <li><a href="<c:url value="/main/github"/>">Github</a></li>
             <li><a href="<c:url value="/main/linkedin"/>">LinkedIn</a></li>
           	<li><a href="<c:url value="/main/microsoft"/>">Microsoft</a></li>
+          	<li><a href="<c:url value="/main/instagram"/>">Instagram</a></li>
           	<li><a href="<c:url value="/main/smart_gallery"/>">Smart Gallery</a></li>
           </ul>
         </div>



Mime
View raw message