According to Authenticator spec, if we set setDefault() to null then it should remove the previously set authenticator. But its not removing. After setting it to null also still it uses that user info to access the resource.
How to reproduce it:
===================
1. Take the attached TestNullAuth.java
2. Need to setup a realm with some user list(I have used apache)
3. Execute this to get below showing output
java TestNullAuth
Response url1: 401
npath = /AuthCheck/
opath = /AuthCheck/
second Response url1: 200
Response for url2: 200 -> This is after setting setDefault to null
third Response for url1: 200 -> This is after setting setDefault to null
How to reproduce it:
===================
1. Take the attached TestNullAuth.java
2. Need to setup a realm with some user list(I have used apache)
3. Execute this to get below showing output
java TestNullAuth
Response url1: 401
npath = /AuthCheck/
opath = /AuthCheck/
second Response url1: 200
Response for url2: 200 -> This is after setting setDefault to null
third Response for url1: 200 -> This is after setting setDefault to null