cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Fixing OIDC RP endpoint and basic_oidc demo
Date Wed, 16 Dec 2015 12:49:35 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 2ccfaa381 -> 6a89ad0de


Fixing OIDC RP endpoint and basic_oidc demo


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/6a89ad0d
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/6a89ad0d
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/6a89ad0d

Branch: refs/heads/3.1.x-fixes
Commit: 6a89ad0deeeedcc6336fde214837d852256e34be
Parents: 2ccfaa3
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Wed Dec 16 12:47:57 2015 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Wed Dec 16 12:49:16 2015 +0000

----------------------------------------------------------------------
 .../src/main/java/demo/jaxrs/server/IdTokenService.java   | 10 +++++-----
 .../jax_rs/basic_oidc/src/main/webapp/forms/idToken.jsp   |  8 ++++----
 .../rs/security/oidc/rp/OidcRpAuthenticationService.java  |  5 ++---
 3 files changed, 11 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/6a89ad0d/distribution/src/main/release/samples/jax_rs/basic_oidc/src/main/java/demo/jaxrs/server/IdTokenService.java
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/basic_oidc/src/main/java/demo/jaxrs/server/IdTokenService.java
b/distribution/src/main/release/samples/jax_rs/basic_oidc/src/main/java/demo/jaxrs/server/IdTokenService.java
index 2f1a313..785689d 100644
--- a/distribution/src/main/release/samples/jax_rs/basic_oidc/src/main/java/demo/jaxrs/server/IdTokenService.java
+++ b/distribution/src/main/release/samples/jax_rs/basic_oidc/src/main/java/demo/jaxrs/server/IdTokenService.java
@@ -25,21 +25,21 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.Response;
 
-import org.apache.cxf.rs.security.oidc.common.IdToken;
+import org.apache.cxf.rs.security.oidc.rp.IdTokenContext;
 
 @Path("/")
 public class IdTokenService {
     @POST
     @Path("/token")
     @Produces("text/html")
-    public Response getIdTokenFromForm(@Context IdToken idToken) {
-        return getIdToken(idToken);
+    public Response getIdTokenFromForm(@Context IdTokenContext idTokenContext) {
+        return getIdToken(idTokenContext);
     }
     
     @GET
     @Path("/token")
     @Produces("text/html")
-    public Response getIdToken(@Context IdToken idToken) {
-        return Response.ok(idToken).build();
+    public Response getIdToken(@Context IdTokenContext idTokenContext) {
+        return Response.ok(idTokenContext.getIdToken()).build();
     }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/6a89ad0d/distribution/src/main/release/samples/jax_rs/basic_oidc/src/main/webapp/forms/idToken.jsp
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/basic_oidc/src/main/webapp/forms/idToken.jsp
b/distribution/src/main/release/samples/jax_rs/basic_oidc/src/main/webapp/forms/idToken.jsp
index 3791563..a3f9fe5 100644
--- a/distribution/src/main/release/samples/jax_rs/basic_oidc/src/main/webapp/forms/idToken.jsp
+++ b/distribution/src/main/release/samples/jax_rs/basic_oidc/src/main/webapp/forms/idToken.jsp
@@ -1,4 +1,4 @@
-<%@ page import="javax.servlet.http.HttpServletRequest, java.util.Map, org.apache.cxf.rs.security.oidc.common.IdToken"
%>
+<%@ page import="javax.servlet.http.HttpServletRequest, org.apache.cxf.rs.security.oidc.common.IdToken"
%>
 
 <%
     IdToken token = (IdToken) request.getAttribute("data");
@@ -23,11 +23,11 @@
 <table border="1">
     <tr><th><big><big>Property</big></big></th><th><big><big>Value</big></big></th></tr>

     <%
-       for (Map.Entry<String, Object> entry : token.asMap().entrySet()) {
+       for (String key : token.asMap().keySet()) {
     %>
     <tr>
-       <td><big><%= entry.getKey() %></big></big></td>
-       <td><big><big><%= entry.getValue().toString() %></big></big></td>
+       <td><big><%= key %></big></big></td>
+       <td><big><big><%= token.asMap().get(key).toString() %></big></big></td>
     </tr>
     <%
        }

http://git-wip-us.apache.org/repos/asf/cxf/blob/6a89ad0d/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcRpAuthenticationService.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcRpAuthenticationService.java
b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcRpAuthenticationService.java
index 93fdd1c..39c7b7b 100644
--- a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcRpAuthenticationService.java
+++ b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/rp/OidcRpAuthenticationService.java
@@ -32,7 +32,6 @@ import javax.ws.rs.core.UriBuilder;
 
 import org.apache.cxf.jaxrs.ext.MessageContext;
 import org.apache.cxf.rs.security.oauth2.client.ClientTokenContextManager;
-import org.apache.cxf.rs.security.oidc.common.IdToken;
 
 @Path("rp")
 public class OidcRpAuthenticationService {
@@ -44,9 +43,9 @@ public class OidcRpAuthenticationService {
     @POST
     @Path("signin")
     @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
-    public Response completeScriptAuthentication(@Context IdToken idToken) {
+    public Response completeScriptAuthentication(@Context IdTokenContext idTokenContext)
{
         OidcClientTokenContextImpl ctx = new OidcClientTokenContextImpl();
-        ctx.setIdToken(idToken);
+        ctx.setIdToken(idTokenContext.getIdToken());
         return completeAuthentication(ctx);   
     }
     


Mime
View raw message