SSO authentication for Confluence Server not working for version 5.3.* ? Edited

I am trying to do a plugin for SSO authentication for Confluence Server. We have used DefaultAuthenticator to logging the user in. This currently works on different versions of Confluence 5.x but does not work on version 5.3.x (like 5.3.0 and 5.3.4) . 

 
After investigating further, we found that Confluence authoriseAndEstablish function returns true but it does not return the expected headers back. This only happens for Confluence 5.3.x.
  1. Expected Parameters in response header
  2.  
  3. X-AUSERNAME:
    admin
  4. X-Confluence-Request-Time:
    XXX
  5. X-Content-Type-Options:
    nosniff
  6. X-Seraph-LoginReason:
    OK

Actual

  1. X-Confluence-Request-Time:
    XXX
  2. X-Content-Type-Options:
    nosniff
  3. X-XSS-Protection:
    1; mode=block

From the different log file the observed difference was -

DEBUG [atlassian.seraph.auth.DefaultAuthenticator] getUserFromSession getUserFromSession : Session found; "<USERNAME>" is present
[confluence.security.seraph.ConfluenceAuthenticatorUtils] asConfluenceUserPrincipal Principal (name="<USERNAME>", class=class com.atlassian.confluence.user.ConfluenceUserImpl$$EnhancerByCGLIB$$d538ed74 is not an instance of ConfluenceUserPrincipal and cannot be used for authentication
[atlassian.seraph.auth.DefaultAuthenticator] getUser getUser : User not found in either Session, Cookie or Basic Auth.
DEBUG [atlassian.seraph.filter.SecurityFilter] doFilter doFilter : Storing the originally requested URL (atlassian.core.seraph.original.url=/login.action?os_destination=%2Findex.action)
DEBUG [atlassian.seraph.filter.SecurityFilter] doFilter doFilter : requiredRoles = []
DEBUG [atlassian.plugin.servlet.PluginHttpSessionWrapper] getAttribute getAttribute('seraph_defaultauthenticator_logged_out_user') Popping ClassLoader: null .New ContextClassLoader: WebappClassLoader
context: 
delegate: false

 
Currently my POM has the following details for Confluence version. 
 
<properties>
<confluence.version>5.0</confluence.version>
<confluence.data.version>5.0</confluence.data.version>
<amps.version>6.2.11</amps.version>
<plugin.testrunner.version>1.2.3</plugin.testrunner.version>
<atlassian.spring.scanner.version>1.2.13</atlassian.spring.scanner.version>
<!-- This key is used to keep the consistency between the key in atlassian-plugin.xml
and the key to generate bundle. -->
<atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
</properties>
 
We also tried changing it to Confluence 5.3.4 and running it. It gives the same error. Any help is highly appreciated.

1 answer

This widget could not be displayed.

Hi,

Me too facing same issue for Confluence 5.3.4 and 5.3.0.

Quick response will be very helpful.

Thanks in advance.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted yesterday in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

135 views 1 4
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you