incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asa...@apache.org
Subject svn commit: r1482866 - in /sling/whiteboard/asanso/openidconnect: pom.xml src/main/java/org/apache/sling/auth/openidconnect/impl/OpenIDConnectAuthenticationHandler.java src/main/java/org/apache/sling/auth/openidconnect/impl/OpenIdConnectLoginModule.java
Date Wed, 15 May 2013 14:38:06 GMT
Author: asanso
Date: Wed May 15 14:38:06 2013
New Revision: 1482866

URL: http://svn.apache.org/r1482866
Log:
SLING-2759 - Provide an OpenId Connect Authentication Handler 

Modified:
    sling/whiteboard/asanso/openidconnect/pom.xml
    sling/whiteboard/asanso/openidconnect/src/main/java/org/apache/sling/auth/openidconnect/impl/OpenIDConnectAuthenticationHandler.java
    sling/whiteboard/asanso/openidconnect/src/main/java/org/apache/sling/auth/openidconnect/impl/OpenIdConnectLoginModule.java

Modified: sling/whiteboard/asanso/openidconnect/pom.xml
URL: http://svn.apache.org/viewvc/sling/whiteboard/asanso/openidconnect/pom.xml?rev=1482866&r1=1482865&r2=1482866&view=diff
==============================================================================
--- sling/whiteboard/asanso/openidconnect/pom.xml (original)
+++ sling/whiteboard/asanso/openidconnect/pom.xml Wed May 15 14:38:06 2013
@@ -108,6 +108,13 @@
     	</dependency>
     	
     	<dependency>
+      		<groupId>org.apache.oltu.openidconnect</groupId>
+      		<artifactId>org.apache.oltu.openidconnect.client</artifactId>
+      		<version>0.1-SNAPSHOT</version>
+    	</dependency>
+    	
+    	
+    	<dependency>
     		<groupId>org.apache.felix</groupId>
     	    <artifactId>org.apache.felix.jaas</artifactId>
     		<version>0.0.1-R1403198</version>

Modified: sling/whiteboard/asanso/openidconnect/src/main/java/org/apache/sling/auth/openidconnect/impl/OpenIDConnectAuthenticationHandler.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/asanso/openidconnect/src/main/java/org/apache/sling/auth/openidconnect/impl/OpenIDConnectAuthenticationHandler.java?rev=1482866&r1=1482865&r2=1482866&view=diff
==============================================================================
--- sling/whiteboard/asanso/openidconnect/src/main/java/org/apache/sling/auth/openidconnect/impl/OpenIDConnectAuthenticationHandler.java
(original)
+++ sling/whiteboard/asanso/openidconnect/src/main/java/org/apache/sling/auth/openidconnect/impl/OpenIDConnectAuthenticationHandler.java
Wed May 15 14:38:06 2013
@@ -19,6 +19,7 @@
 package org.apache.sling.auth.openidconnect.impl;
 
 import java.io.IOException;
+import java.net.URL;
 import java.util.Dictionary;
 import javax.security.auth.spi.LoginModule;
 import javax.servlet.http.HttpServletRequest;
@@ -43,6 +44,7 @@ import org.apache.oltu.oauth2.client.res
 import org.apache.oltu.oauth2.common.OAuth;
 import org.apache.oltu.oauth2.common.message.types.GrantType;
 import org.apache.oltu.oauth2.common.message.types.ResponseType;
+import org.apache.oltu.openidconnect.client.response.OpenIdConnectResponse;
 import org.apache.sling.auth.core.spi.AuthenticationHandler;
 import org.apache.sling.auth.core.spi.AuthenticationInfo;
 import org.apache.sling.commons.osgi.OsgiUtil;
@@ -115,9 +117,13 @@ public class OpenIDConnectAuthentication
 
 				OAuthClient client = new OAuthClient(new URLConnectionClient());
 				OAuthAccessTokenResponse oauthResponse = client.accessToken(
-						req, OAuthJSONAccessTokenResponse.class);
-
-				log.error("oauthResponse " + oauthResponse.getAccessToken());
+						req, OpenIdConnectResponse.class);
+				
+				URL url = new URL(tokenEndpoint);
+ 
+				boolean validToken = ((OpenIdConnectResponse)oauthResponse).checkId( url.getHost(), clientId);
+				
+				log.error("token valid "+validToken);
 
 			} else {
 				OAuthClientRequest clientRequest = OAuthClientRequest

Modified: sling/whiteboard/asanso/openidconnect/src/main/java/org/apache/sling/auth/openidconnect/impl/OpenIdConnectLoginModule.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/asanso/openidconnect/src/main/java/org/apache/sling/auth/openidconnect/impl/OpenIdConnectLoginModule.java?rev=1482866&r1=1482865&r2=1482866&view=diff
==============================================================================
--- sling/whiteboard/asanso/openidconnect/src/main/java/org/apache/sling/auth/openidconnect/impl/OpenIdConnectLoginModule.java
(original)
+++ sling/whiteboard/asanso/openidconnect/src/main/java/org/apache/sling/auth/openidconnect/impl/OpenIdConnectLoginModule.java
Wed May 15 14:38:06 2013
@@ -23,7 +23,6 @@ import javax.security.auth.Subject;
 import javax.security.auth.callback.CallbackHandler;
 import javax.security.auth.login.LoginException;
 import javax.security.auth.spi.LoginModule;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 



Mime
View raw message