oltu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asa...@apache.org
Subject svn commit: r1759584 - 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 10:59:20 GMT
Author: asanso
Date: Wed Sep  7 10:59:19 2016
New Revision: 1759584

URL: http://svn.apache.org/viewvc?rev=1759584&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=1759584&r1=1759583&r2=1759584&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 10:59:19 2016
@@ -80,6 +80,12 @@ public final class Utils {
     public static final String GITHUB_TOKEN = OAuthProviderType.GITHUB.getTokenEndpoint();
     public static final String GITHUB_SCOPE = "";
     public static final String GITHUB_RESOURCE_URL = "https://api.github.com/user";
+    
+    public static final String MICROSOFT = OAuthProviderType.MICROSOFT.getProviderName();
+    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 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=1759584&r1=1759583&r2=1759584&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 10:59:19 2016
@@ -83,6 +83,9 @@ public class MainController {
         } else if (Utils.LINKEDIN.equalsIgnoreCase(app)) {
             selected = true;
             addLinkedInParams(oauthParams);
+        }  else if (Utils.MICROSOFT.equalsIgnoreCase(app)) {
+            selected = true;
+            addMicrosfotParams(oauthParams);
         }
 
         if (selected) {
@@ -125,6 +128,12 @@ public class MainController {
         oauthParams.setTokenEndpoint(Utils.GITHUB_TOKEN);
         oauthParams.setScope(Utils.GITHUB_SCOPE);
     }
+    
+    private void addMicrosfotParams(OAuthParams oauthParams) {
+        oauthParams.setAuthzEndpoint(Utils.MICROSOFT_AUTHZ);
+        oauthParams.setTokenEndpoint(Utils.MICROSOFT_TOKEN);
+        oauthParams.setScope(Utils.MICROSOFT_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=1759584&r1=1759583&r2=1759584&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 10:59:19
2016
@@ -43,11 +43,12 @@
         <div class="collapse navbar-collapse navbar-ex1-collapse">
           <ul class="nav navbar-nav">
             <li><a href="<c:url value="/main/generic"/>">Generic OAuth2
Application</a></li>
-            <li><a href="<c:url value="/main/smart_gallery"/>">Smart Gallery</a></li>
             <li><a href="<c:url value="/main/facebook"/>">Facebook</a></li>
             <li><a href="<c:url value="/main/google"/>">Google</a></li>
             <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/smart_gallery"/>">Smart Gallery</a></li>
           </ul>
         </div>
       </nav>



Mime
View raw message