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