Bug 58698

Summary: HTTP Authorization Manager cannot load an auth.txt it saved
Product: JMeter - Now in Github Reporter: mike.palandra
Component: HTTPAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: minor    
Priority: P2    
Version: 2.13   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description mike.palandra 2015-12-07 19:12:01 UTC
1)  Start JMeter GUI

2)  Add a HTTP Authorization Manager config element to the test plan, and select it

3)  Press "Add" button, and proceed to enter the following values for a single authorization:
Base URL:  http://jmeter.apache.org/
Username:  user
Password:  pass

4)  Press the "Save" button to create "auth.txt"

5)  Delete the authorization added in step 3

6)  Press the "Load" button, and select the file created in step 4

7)  Error message:  "One or more errors found when reading the Auth file - see the log file"

Relevant excerpt from log file:
"2015/12/07 13:14:18 ERROR - jmeter.protocol.http.control.AuthManager: Error parsing auth line: 'http://jmeter.apache.org/	user	pass			BASIC_DIGEST' "


Note:  if "auth.txt" is edited in a text editor such that only the (3) fields actually entered within JMeter are retained; i.e. Base URL, Username, and Password, then this modified auth.txt file will load successfully.
Comment 1 Felix Schumacher 2015-12-12 15:18:55 UTC
Date: Sat Dec 12 15:16:48 2015
New Revision: 1719699

URL: http://svn.apache.org/viewvc?rev=1719699&view=rev
Log:
Bug 58698: Correct parsing of auth-files in HTTP Authorization Manager.

Bugzilla Id: 58698

Added:
    jmeter/trunk/test/src/org/apache/jmeter/protocol/http/control/AuthManagerTest.java
Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java
    jmeter/trunk/xdocs/changes.xml
Comment 2 Felix Schumacher 2015-12-12 15:37:31 UTC
Date: Sat Dec 12 15:35:52 2015
New Revision: 1719702

URL: http://svn.apache.org/viewvc?rev=1719702&view=rev
Log:
Followup to r1719699

There was already a test case for AuthManager, so use that one.
Correct offset for length of splitted array, so that old auth infos can be read.

Bugzilla Id: 58698

Removed:
    jmeter/trunk/test/src/org/apache/jmeter/protocol/http/control/AuthManagerTest.java
Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java
    jmeter/trunk/test/src/org/apache/jmeter/protocol/http/control/TestAuthManager.java
Comment 3 The ASF infrastructure team 2022-09-24 20:38:01 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/3719