@@ -100,9 +100,7 @@ export default function({ getService }: FtrProviderContext) {
100100 } ) ;
101101 } ) ;
102102
103- // Preventing ES Snapshot to be promoted
104- // https://github.com/elastic/kibana/issues/65114
105- describe . skip ( 'finishing SPNEGO' , ( ) => {
103+ describe ( 'finishing SPNEGO' , ( ) => {
106104 it ( 'should properly set cookie and authenticate user' , async ( ) => {
107105 const response = await supertest
108106 . get ( '/internal/security/me' )
@@ -120,13 +118,22 @@ export default function({ getService }: FtrProviderContext) {
120118 const sessionCookie = request . cookie ( cookies [ 0 ] ) ! ;
121119 checkCookieIsSet ( sessionCookie ) ;
122120
121+ const isAnonymousAccessEnabled = ( config . get (
122+ 'esTestCluster.serverArgs'
123+ ) as string [ ] ) . some ( setting => setting . startsWith ( 'xpack.security.authc.anonymous' ) ) ;
124+
125+ // `superuser_anonymous` role is derived from the enabled anonymous access.
126+ const expectedUserRoles = isAnonymousAccessEnabled
127+ ? [ 'kibana_admin' , 'superuser_anonymous' ]
128+ : [ 'kibana_admin' ] ;
129+
123130 await supertest
124131 . get ( '/internal/security/me' )
125132 . set ( 'kbn-xsrf' , 'xxx' )
126133 . set ( 'Cookie' , sessionCookie . cookieString ( ) )
127134 . expect ( 200 , {
128135129- roles : [ 'kibana_admin' ] ,
136+ roles : expectedUserRoles ,
130137 full_name : null ,
131138 email : null ,
132139 metadata : {
0 commit comments