Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Authenticate with servlet app using Basic Auth and 2-step-verification

Matthias Loeks
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 14, 2025

Hello,

after upgrading from Confluence DC 8.5 to 9.2, I cannot authenticate requests against my servlet app endpoint anymore using Basic Authentication, (likely) due to the recently introduced 2-step-verification.

When calling the servlet endpoint using a valid (admin) user with Basic Auth headers, I can see that the authentication gets invalidated after the first request in this log: 

DEBUG [http-nio-8090-exec-5 url: /plugins/servlet/myendpoint]
[authentication.basicauth.filter.DisableBasicAuthFilter] invalidateSessionIfNativeLoginRestricted
Session for Basic Authentication will be invalidated because the 2SV-capable login mode is enabled

However, as far as I can see I do not even have 2-step-verification enabled in my instance.

After invalidation, subsequent requests are issued with the user "anonymous". This still works, but only if I put the @UnrestrictedAccess annotation onto my servlet, which obviously seems the wrong way to go.

PAT-based authentication is not affected by this and works fine. I know PAT is the recommended and preferred way to authenticate, but I would like to keep Basic Auth working if possible.

My main questions are:

  1. Is the observed behaviour correct, with 2SV seemingly being disabled?
  2. Where can I properly switch off the "2SV-capable login mode"?
  3. In which JAR is the DisableBasicAuthFilter code situated? I found it difficult to troubleshoot this issue in the debugger.
  4. With the advent of 2SV, is the usage of Basic Auth for authenticating against servlet app endpoints even still supported at all?
  5. Why does this not affect PAT based authentication?

Many thanks for your support!

1 answer

0 votes
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 15, 2025

Hi @Matthias Loeks 

Welcome to the community.

Documentation on manage-two-step-verification-for-your-atlassian-account 

I'm not sure but it could be related to this Bug (JRASERVER-78386 )

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
9.2
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events