Return-Path: X-Original-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8DCF4C601 for ; Wed, 16 May 2012 20:14:12 +0000 (UTC) Received: (qmail 47362 invoked by uid 500); 16 May 2012 20:14:12 -0000 Delivered-To: apmail-incubator-callback-commits-archive@incubator.apache.org Received: (qmail 47313 invoked by uid 500); 16 May 2012 20:14:12 -0000 Mailing-List: contact callback-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-commits@incubator.apache.org Received: (qmail 47301 invoked by uid 99); 16 May 2012 20:14:12 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 May 2012 20:14:12 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id DABA716487; Wed, 16 May 2012 20:14:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bcurtis@apache.org To: callback-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: android commit: CB-369: Authentication Code doesn't seem to work. -- Verified basic auth works and provided test case. Message-Id: <20120516201411.DABA716487@tyr.zones.apache.org> Date: Wed, 16 May 2012 20:14:11 +0000 (UTC) Updated Branches: refs/heads/CordovaWebView 47d99e519 -> 2fbb9c285 CB-369: Authentication Code doesn't seem to work. -- Verified basic auth works and provided test case. Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/2fbb9c28 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/2fbb9c28 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/2fbb9c28 Branch: refs/heads/CordovaWebView Commit: 2fbb9c285d52ce9ffd43359fa25e95edad074b13 Parents: 47d99e5 Author: Bryce Curtis Authored: Wed May 16 15:13:42 2012 -0500 Committer: Bryce Curtis Committed: Wed May 16 15:13:42 2012 -0500 ---------------------------------------------------------------------- test/AndroidManifest.xml | 3 + test/assets/www/basicauth/index.html | 42 ++++++++++++++++ test/assets/www/index.html | 33 +++++++------ test/src/org/apache/cordova/test/basicauth.java | 46 ++++++++++++++++++ 4 files changed, 108 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/2fbb9c28/test/AndroidManifest.xml ---------------------------------------------------------------------- diff --git a/test/AndroidManifest.xml b/test/AndroidManifest.xml old mode 100644 new mode 100755 index b8038c7..4918fe5 --- a/test/AndroidManifest.xml +++ b/test/AndroidManifest.xml @@ -144,5 +144,8 @@ + + http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/2fbb9c28/test/assets/www/basicauth/index.html ---------------------------------------------------------------------- diff --git a/test/assets/www/basicauth/index.html b/test/assets/www/basicauth/index.html new file mode 100755 index 0000000..02ff0b2 --- /dev/null +++ b/test/assets/www/basicauth/index.html @@ -0,0 +1,42 @@ + + + + + + + Cordova Tests + + + + + +

Basic Auth

+
+

Platform:  , Version:  

+

UUID:  , Name:  

+

Width:  , Height:   + , Color Depth:

+
+
+ Loading link below should be successful and show page indicating username=test & password=test.
+
+ Test password + + http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/2fbb9c28/test/assets/www/index.html ---------------------------------------------------------------------- diff --git a/test/assets/www/index.html b/test/assets/www/index.html index 0fd4eaf..6838156 100755 --- a/test/assets/www/index.html +++ b/test/assets/www/index.html @@ -1,20 +1,20 @@ @@ -49,6 +49,7 @@ $ + http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/2fbb9c28/test/src/org/apache/cordova/test/basicauth.java ---------------------------------------------------------------------- diff --git a/test/src/org/apache/cordova/test/basicauth.java b/test/src/org/apache/cordova/test/basicauth.java new file mode 100755 index 0000000..4007c97 --- /dev/null +++ b/test/src/org/apache/cordova/test/basicauth.java @@ -0,0 +1,46 @@ +/* + 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.cordova.test; + +import android.os.Bundle; +import android.webkit.WebView; + +import org.apache.cordova.*; +import org.apache.cordova.api.LOG; + +public class basicauth extends DroidGap { + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + super.init(); + + // LogCat: onReceivedHttpAuthRequest(browserspy.dk:80,BrowserSpy.dk - HTTP Password Test) + AuthenticationToken token = new AuthenticationToken(); + token.setUserName("test"); + token.setPassword("test"); + super.setAuthenticationToken(token, "browserspy.dk:80", "BrowserSpy.dk - HTTP Password Test"); + + // Add web site to whitelist + super.appView.addWhiteListEntry("http://browserspy.dk*", true); + + // Load test + super.loadUrl("file:///android_asset/www/basicauth/index.html"); + } + +}