deletetoken.jsp revision e8721886dbfd32e88cc7077cbee4b6bb1b44b443
747612c740f3dae2c06b9402fa4679344d115a5ahajma<%--
747612c740f3dae2c06b9402fa4679344d115a5ahajma DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
747612c740f3dae2c06b9402fa4679344d115a5ahajma
747612c740f3dae2c06b9402fa4679344d115a5ahajma Copyright (c) 2009 Sun Microsystems Inc. All Rights Reserved
747612c740f3dae2c06b9402fa4679344d115a5ahajma
747612c740f3dae2c06b9402fa4679344d115a5ahajma The contents of this file are subject to the terms
747612c740f3dae2c06b9402fa4679344d115a5ahajma of the Common Development and Distribution License
747612c740f3dae2c06b9402fa4679344d115a5ahajma (the License). You may not use this file except in
747612c740f3dae2c06b9402fa4679344d115a5ahajma compliance with the License.
747612c740f3dae2c06b9402fa4679344d115a5ahajma
747612c740f3dae2c06b9402fa4679344d115a5ahajma You can obtain a copy of the License at
747612c740f3dae2c06b9402fa4679344d115a5ahajma https://opensso.dev.java.net/public/CDDLv1.0.html or
747612c740f3dae2c06b9402fa4679344d115a5ahajma opensso/legal/CDDLv1.0.txt
747612c740f3dae2c06b9402fa4679344d115a5ahajma See the License for the specific language governing
747612c740f3dae2c06b9402fa4679344d115a5ahajma permission and limitations under the License.
747612c740f3dae2c06b9402fa4679344d115a5ahajma
747612c740f3dae2c06b9402fa4679344d115a5ahajma When distributing Covered Code, include this CDDL
747612c740f3dae2c06b9402fa4679344d115a5ahajma Header Notice in each file and include the License file
at opensso/legal/CDDLv1.0.txt.
If applicable, add the following below the CDDL Header,
with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
$Id: deletetoken.jsp,v 1.1 2009/11/20 19:25:15 huacui Exp $
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>OAuth Token Deletion</title>
</head>
<body>
<br><br>
<h1>Deleting the OAuth token ...</h1>
<%
String oauth_token = request.getParameter("oauth_token");
try {
java.net.URL url = new java.net.URL(oauth_token);
java.net.HttpURLConnection conn = (java.net.HttpURLConnection) url.openConnection();
conn.setRequestMethod("DELETE");
conn.connect();
int resp = conn.getResponseCode();
if (resp == 200) {
out.println("OAuth Request Token deleted.");
} else {
out.println("OAuth Request Token could not be deleted - Unauthorized.");
}
} catch (Exception ex) {
ex.printStackTrace(new java.io.PrintWriter(out));
}
%>
</body>
</html>