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