You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2016/01/14 13:30:20 UTC
cxf-fediz git commit: Presenting access and refresh tokens in the
same screen, they will be typically linked so UI experience can be optimized,
etc
Repository: cxf-fediz
Updated Branches:
refs/heads/master 0d11fba7b -> 1813605d1
Presenting access and refresh tokens in the same screen, they will be typically linked so UI experience can be optimized, etc
Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/1813605d
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/1813605d
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/1813605d
Branch: refs/heads/master
Commit: 1813605d1fd62f3f5c3ce9e3a5c5b2106d048e47
Parents: 0d11fba
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Thu Jan 14 12:30:00 2016 +0000
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Thu Jan 14 12:30:00 2016 +0000
----------------------------------------------------------------------
.../fediz/service/oidc/ClientAccessTokens.java | 48 -------
.../fediz/service/oidc/ClientRefreshTokens.java | 48 -------
.../service/oidc/ClientRegistrationService.java | 40 +++---
.../cxf/fediz/service/oidc/ClientTokens.java | 48 +++++++
.../src/main/webapp/WEB-INF/views/client.jsp | 7 +-
.../webapp/WEB-INF/views/clientAccessTokens.jsp | 92 -------------
.../WEB-INF/views/clientRefreshTokens.jsp | 92 -------------
.../main/webapp/WEB-INF/views/clientTokens.jsp | 133 +++++++++++++++++++
8 files changed, 204 insertions(+), 304 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/1813605d/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientAccessTokens.java
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientAccessTokens.java b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientAccessTokens.java
deleted file mode 100644
index 061e61d..0000000
--- a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientAccessTokens.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.fediz.service.oidc;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import org.apache.cxf.rs.security.oauth2.common.Client;
-import org.apache.cxf.rs.security.oauth2.common.ServerAccessToken;
-
-public class ClientAccessTokens {
- private Client client;
- private List<ServerAccessToken> accessTokens = new LinkedList<ServerAccessToken>();
- public ClientAccessTokens(Client c, List<ServerAccessToken> accessTokens) {
- this.client = c;
- this.accessTokens = accessTokens;
- }
- public Client getClient() {
- return client;
- }
- public void setClient(Client client) {
- this.client = client;
- }
- public List<ServerAccessToken> getAccessTokens() {
- return accessTokens;
- }
- public void setAccessTokens(List<ServerAccessToken> accessTokens) {
- this.accessTokens = accessTokens;
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/1813605d/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRefreshTokens.java
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRefreshTokens.java b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRefreshTokens.java
deleted file mode 100644
index 12f246f..0000000
--- a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRefreshTokens.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.fediz.service.oidc;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import org.apache.cxf.rs.security.oauth2.common.Client;
-import org.apache.cxf.rs.security.oauth2.tokens.refresh.RefreshToken;
-
-public class ClientRefreshTokens {
- private Client client;
- private List<RefreshToken> refreshTokens = new LinkedList<RefreshToken>();
- public ClientRefreshTokens(Client c, List<RefreshToken> refreshTokens) {
- this.client = c;
- this.refreshTokens = refreshTokens;
- }
- public Client getClient() {
- return client;
- }
- public void setClient(Client client) {
- this.client = client;
- }
- public List<RefreshToken> getRefreshTokens() {
- return refreshTokens;
- }
- public void setRefreshTokens(List<RefreshToken> refreshTokens) {
- this.refreshTokens = refreshTokens;
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/1813605d/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRegistrationService.java
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRegistrationService.java b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRegistrationService.java
index b5dfff5..af0dc7f 100644
--- a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRegistrationService.java
+++ b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientRegistrationService.java
@@ -114,39 +114,41 @@ public class ClientRegistrationService {
@GET
@Produces(MediaType.TEXT_HTML)
- @Path("/{id}/at")
- public ClientAccessTokens getClientAccessTokens(@PathParam("id") String id) {
+ @Path("/{id}/tokens")
+ public ClientTokens getClientIssuedTokens(@PathParam("id") String id) {
Client c = getRegisteredClient(id);
- return new ClientAccessTokens(c, manager.getAccessTokens(c));
+ return doGetClientIssuedTokens(c);
+ }
+
+ protected ClientTokens doGetClientIssuedTokens(Client c) {
+ return new ClientTokens(c,
+ manager.getAccessTokens(c),
+ manager.getRefreshTokens(c));
}
@POST
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces(MediaType.TEXT_HTML)
@Path("/{id}/at/{tokenId}/revoke")
- public ClientAccessTokens revokeClientAccessToken(@PathParam("id") String id,
+ public ClientTokens revokeClientAccessToken(@PathParam("id") String clientId,
@PathParam("tokenId") String tokenId) {
- Client c = getRegisteredClient(id);
- manager.revokeToken(c, tokenId, OAuthConstants.ACCESS_TOKEN);
- return new ClientAccessTokens(c, manager.getAccessTokens(c));
- }
-
- @GET
- @Produces(MediaType.TEXT_HTML)
- @Path("/{id}/rt")
- public ClientRefreshTokens getClientRefreshTokens(@PathParam("id") String id) {
- Client c = getRegisteredClient(id);
- return new ClientRefreshTokens(c, manager.getRefreshTokens(c));
+ return doRevokeClientToken(clientId, tokenId, OAuthConstants.ACCESS_TOKEN);
}
@POST
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces(MediaType.TEXT_HTML)
@Path("/{id}/rt/{tokenId}/revoke")
- public ClientRefreshTokens revokeClientRefreshToken(@PathParam("id") String id,
+ public ClientTokens revokeClientRefreshToken(@PathParam("id") String clientId,
@PathParam("tokenId") String tokenId) {
- Client c = getRegisteredClient(id);
- manager.revokeToken(c, tokenId, OAuthConstants.REFRESH_TOKEN);
- return new ClientRefreshTokens(c, manager.getRefreshTokens(c));
+ return doRevokeClientToken(clientId, tokenId, OAuthConstants.REFRESH_TOKEN);
+ }
+
+ protected ClientTokens doRevokeClientToken(String clientId,
+ String tokenId,
+ String tokenType) {
+ Client c = getRegisteredClient(clientId);
+ manager.revokeToken(c, tokenId, tokenType);
+ return doGetClientIssuedTokens(c);
}
@GET
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/1813605d/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientTokens.java
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientTokens.java b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientTokens.java
new file mode 100644
index 0000000..e7ad7f6
--- /dev/null
+++ b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/ClientTokens.java
@@ -0,0 +1,48 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.fediz.service.oidc;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.cxf.rs.security.oauth2.common.Client;
+import org.apache.cxf.rs.security.oauth2.common.ServerAccessToken;
+import org.apache.cxf.rs.security.oauth2.tokens.refresh.RefreshToken;
+
+public class ClientTokens {
+ private Client client;
+ private List<ServerAccessToken> accessTokens = new LinkedList<ServerAccessToken>();
+ private List<RefreshToken> refreshTokens = new LinkedList<RefreshToken>();
+ public ClientTokens(Client c,
+ List<ServerAccessToken> accessTokens,
+ List<RefreshToken> refreshTokens) {
+ this.client = c;
+ this.accessTokens = accessTokens;
+ this.refreshTokens = refreshTokens;
+ }
+ public Client getClient() {
+ return client;
+ }
+ public List<ServerAccessToken> getAccessTokens() {
+ return accessTokens;
+ }
+ public List<RefreshToken> getRefreshTokens() {
+ return refreshTokens;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/1813605d/services/oidc/src/main/webapp/WEB-INF/views/client.jsp
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/webapp/WEB-INF/views/client.jsp b/services/oidc/src/main/webapp/WEB-INF/views/client.jsp
index c704511..fb9d4f9 100644
--- a/services/oidc/src/main/webapp/WEB-INF/views/client.jsp
+++ b/services/oidc/src/main/webapp/WEB-INF/views/client.jsp
@@ -124,13 +124,10 @@
</table>
<br/>
<p>
-<p><a href="<%= basePath + "clients/" + client.getClientId() + "/at" %>">Current Access Tokens</a></p>
+<p><a href="<%= basePath + "clients/" + client.getClientId() + "/tokens" %>">Issued Tokens</a></p>
</p>
<p>
-<p><a href="<%= basePath + "clients/" + client.getClientId() + "/rt" %>">Current Refresh Tokens</a></p>
-</p>
-<p>
-<p><a href="<%= basePath + "clients/" + client.getClientId() + "/codes" %>">Current Code Grants</a></p>
+<p><a href="<%= basePath + "clients/" + client.getClientId() + "/codes" %>">Issued Code Grants</a></p>
</p>
<br/>
<p>
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/1813605d/services/oidc/src/main/webapp/WEB-INF/views/clientAccessTokens.jsp
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/webapp/WEB-INF/views/clientAccessTokens.jsp b/services/oidc/src/main/webapp/WEB-INF/views/clientAccessTokens.jsp
deleted file mode 100644
index 511757d..0000000
--- a/services/oidc/src/main/webapp/WEB-INF/views/clientAccessTokens.jsp
+++ /dev/null
@@ -1,92 +0,0 @@
-<%@ page import="org.apache.cxf.rs.security.oauth2.common.Client"%>
-<%@ page import="org.apache.cxf.rs.security.oauth2.common.ServerAccessToken"%>
-<%@ page import="java.text.SimpleDateFormat"%>
-<%@ page import="java.util.Date"%>
-<%@ page import="java.util.List"%>
-<%@ page import="java.util.Locale"%>
-<%@ page import="java.util.TimeZone"%>
-<%@ page import="javax.servlet.http.HttpServletRequest" %>
-<%@ page import="org.apache.cxf.fediz.service.oidc.ClientAccessTokens" %>
-
-<%
- ClientAccessTokens tokens = (ClientAccessTokens)request.getAttribute("data");
- Client client = tokens.getClient();
- String basePath = request.getContextPath() + request.getServletPath();
- if (!basePath.endsWith("/")) {
- basePath += "/";
- }
-%>
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title>Client Access Tokens</title>
- <STYLE TYPE="text/css">
- table {
- border-collapse: collapse;
- }
- table th {
- background-color: #f0f0f0;
- border-color: #ccc;
- border-style: solid;
- border-width: 1px;
- padding: 3px 4px;
- text-align: center;
- }
- table td {
- border-color: #ccc;
- border-style: solid;
- border-width: 1px;
- padding: 3px 4px;
- }
- </STYLE>
-</head>
-<body>
-<div class="padded">
-<h1>Access Tokens issued to <%= client.getApplicationName() + "(" + client.getClientId() + ")"%></h1>
-<br/>
-<table border="1">
- <tr><th>Identifier</th><th>Issue Date</th><th>Expiry Date</th></tr>
- <%
- SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss", Locale.US);
- dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
-
- for (ServerAccessToken token : tokens.getAccessTokens()) {
- %>
- <tr>
- <td><input type="text" name="tokenId" size="15" readonly="readonly" value="<%= token.getTokenKey() %>" /></td>
- <td>
- <%
- Date issuedDate = new Date(token.getIssuedAt() * 1000);
- String issued = dateFormat.format(issuedDate);
- %>
- <%= issued %><br/>
- </td>
- <td>
- <%
- Date expiresDate = new Date((token.getIssuedAt() + token.getExpiresIn()) * 1000);
- String expires = dateFormat.format(expiresDate);
- %>
- <%= expires %><br/>
- </td>
- <td>
- <form action="/fediz-oidc/clients/<%= client.getClientId() + "/at/" + token.getTokenKey() + "/revoke"%>" method="POST">
- <div data-type="control_button" class="form-line">
- <button class="form-submit-button" type="submit">Delete</button>
- </div>
- </form>
- </td>
- </tr>
- <%
- }
- %>
-
-</table>
-
-<br/>
-<br/>
-<p>
-<a href="<%= basePath + "clients/" + client.getClientId() %>">Return</a>
-</p>
-</div>
-</body>
-</html>
-
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/1813605d/services/oidc/src/main/webapp/WEB-INF/views/clientRefreshTokens.jsp
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/webapp/WEB-INF/views/clientRefreshTokens.jsp b/services/oidc/src/main/webapp/WEB-INF/views/clientRefreshTokens.jsp
deleted file mode 100644
index 04d615d..0000000
--- a/services/oidc/src/main/webapp/WEB-INF/views/clientRefreshTokens.jsp
+++ /dev/null
@@ -1,92 +0,0 @@
-<%@ page import="org.apache.cxf.rs.security.oauth2.common.Client"%>
-<%@ page import="org.apache.cxf.rs.security.oauth2.tokens.refresh.RefreshToken"%>
-<%@ page import="java.text.SimpleDateFormat"%>
-<%@ page import="java.util.Date"%>
-<%@ page import="java.util.List"%>
-<%@ page import="java.util.Locale"%>
-<%@ page import="java.util.TimeZone"%>
-<%@ page import="javax.servlet.http.HttpServletRequest" %>
-<%@ page import="org.apache.cxf.fediz.service.oidc.ClientRefreshTokens" %>
-
-<%
- ClientRefreshTokens tokens = (ClientRefreshTokens)request.getAttribute("data");
- Client client = tokens.getClient();
- String basePath = request.getContextPath() + request.getServletPath();
- if (!basePath.endsWith("/")) {
- basePath += "/";
- }
-%>
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title>Client Refresh Tokens</title>
- <STYLE TYPE="text/css">
- table {
- border-collapse: collapse;
- }
- table th {
- background-color: #f0f0f0;
- border-color: #ccc;
- border-style: solid;
- border-width: 1px;
- padding: 3px 4px;
- text-align: center;
- }
- table td {
- border-color: #ccc;
- border-style: solid;
- border-width: 1px;
- padding: 3px 4px;
- }
- </STYLE>
-</head>
-<body>
-<div class="padded">
-<h1>Refresh Tokens issued to <%= client.getApplicationName() + "(" + client.getClientId() + ")"%></h1>
-<br/>
-<table border="1">
- <tr><th>Identifier</th><th>Issue Date</th><th>Expiry Date</th></tr>
- <%
- SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss", Locale.US);
- dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
-
- for (RefreshToken token : tokens.getRefreshTokens()) {
- %>
- <tr>
- <td><input type="text" name="tokenId" size="15" readonly="readonly" value="<%= token.getTokenKey() %>" /></td>
- <td>
- <%
- Date issuedDate = new Date(token.getIssuedAt() * 1000);
- String issued = dateFormat.format(issuedDate);
- %>
- <%= issued %><br/>
- </td>
- <td>
- <%
- Date expiresDate = new Date((token.getIssuedAt() + token.getExpiresIn()) * 1000);
- String expires = dateFormat.format(expiresDate);
- %>
- <%= expires %><br/>
- </td>
- <td>
- <form action="/fediz-oidc/clients/<%= client.getClientId() + "/rt/" + token.getTokenKey() + "/revoke"%>" method="POST">
- <div data-type="control_button" class="form-line">
- <button class="form-submit-button" type="submit">Delete</button>
- </div>
- </form>
- </td>
- </tr>
- <%
- }
- %>
-
-</table>
-
-<br/>
-<br/>
-<p>
-<a href="<%= basePath + "clients/" + client.getClientId() %>">Return</a>
-</p>
-</div>
-</body>
-</html>
-
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/1813605d/services/oidc/src/main/webapp/WEB-INF/views/clientTokens.jsp
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/webapp/WEB-INF/views/clientTokens.jsp b/services/oidc/src/main/webapp/WEB-INF/views/clientTokens.jsp
new file mode 100644
index 0000000..47d96f4
--- /dev/null
+++ b/services/oidc/src/main/webapp/WEB-INF/views/clientTokens.jsp
@@ -0,0 +1,133 @@
+<%@ page import="org.apache.cxf.rs.security.oauth2.common.Client"%>
+<%@ page import="org.apache.cxf.rs.security.oauth2.common.ServerAccessToken"%>
+<%@ page import="org.apache.cxf.rs.security.oauth2.tokens.refresh.RefreshToken"%>
+<%@ page import="java.text.SimpleDateFormat"%>
+<%@ page import="java.util.Date"%>
+<%@ page import="java.util.List"%>
+<%@ page import="java.util.Locale"%>
+<%@ page import="java.util.TimeZone"%>
+<%@ page import="javax.servlet.http.HttpServletRequest" %>
+<%@ page import="org.apache.cxf.fediz.service.oidc.ClientTokens" %>
+
+<%
+ ClientTokens tokens = (ClientTokens)request.getAttribute("data");
+ Client client = tokens.getClient();
+ String basePath = request.getContextPath() + request.getServletPath();
+ if (!basePath.endsWith("/")) {
+ basePath += "/";
+ }
+ SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss", Locale.US);
+ dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
+
+%>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>Client Access Tokens</title>
+ <STYLE TYPE="text/css">
+ table {
+ border-collapse: collapse;
+ }
+ table th {
+ background-color: #f0f0f0;
+ border-color: #ccc;
+ border-style: solid;
+ border-width: 1px;
+ padding: 3px 4px;
+ text-align: center;
+ }
+ table td {
+ border-color: #ccc;
+ border-style: solid;
+ border-width: 1px;
+ padding: 3px 4px;
+ }
+ </STYLE>
+</head>
+<body>
+<h1>Tokens issued to <%= client.getApplicationName() + "(" + client.getClientId() + ")"%></h1>
+<br/>
+<br/>
+<div class="padded">
+<h2>Access Tokens</h2>
+<br/>
+<table border="1">
+ <tr><th>Identifier</th><th>Issue Date</th><th>Expiry Date</th></tr>
+ <%
+ for (ServerAccessToken token : tokens.getAccessTokens()) {
+ %>
+ <tr>
+ <td><input type="text" name="tokenId" size="15" readonly="readonly" value="<%= token.getTokenKey() %>" /></td>
+ <td>
+ <%
+ Date issuedDate = new Date(token.getIssuedAt() * 1000);
+ String issued = dateFormat.format(issuedDate);
+ %>
+ <%= issued %><br/>
+ </td>
+ <td>
+ <%
+ Date expiresDate = new Date((token.getIssuedAt() + token.getExpiresIn()) * 1000);
+ String expires = dateFormat.format(expiresDate);
+ %>
+ <%= expires %><br/>
+ </td>
+ <td>
+ <form action="/fediz-oidc/clients/<%= client.getClientId() + "/at/" + token.getTokenKey() + "/revoke"%>" method="POST">
+ <div data-type="control_button" class="form-line">
+ <button class="form-submit-button" type="submit">Delete</button>
+ </div>
+ </form>
+ </td>
+ </tr>
+ <%
+ }
+ %>
+
+</table>
+<br/>
+<h2>Refresh Tokens</h2>
+<br/>
+<table border="1">
+ <tr><th>Identifier</th><th>Issue Date</th><th>Expiry Date</th></tr>
+ <%
+ for (RefreshToken token : tokens.getRefreshTokens()) {
+ %>
+ <tr>
+ <td><input type="text" name="tokenId" size="15" readonly="readonly" value="<%= token.getTokenKey() %>" /></td>
+ <td>
+ <%
+ Date issuedDate = new Date(token.getIssuedAt() * 1000);
+ String issued = dateFormat.format(issuedDate);
+ %>
+ <%= issued %><br/>
+ </td>
+ <td>
+ <%
+ Date expiresDate = new Date((token.getIssuedAt() + token.getExpiresIn()) * 1000);
+ String expires = dateFormat.format(expiresDate);
+ %>
+ <%= expires %><br/>
+ </td>
+ <td>
+ <form action="/fediz-oidc/clients/<%= client.getClientId() + "/rt/" + token.getTokenKey() + "/revoke"%>" method="POST">
+ <div data-type="control_button" class="form-line">
+ <button class="form-submit-button" type="submit">Delete</button>
+ </div>
+ </form>
+ </td>
+ </tr>
+ <%
+ }
+ %>
+
+</table>
+
+<br/>
+<br/>
+<p>
+<a href="<%= basePath + "clients/" + client.getClientId() %>">Return</a>
+</p>
+</div>
+</body>
+</html>
+