@@ -8,28 +8,27 @@ import expect from '@kbn/expect';
88import request , { Cookie } from 'request' ;
99import url from 'url' ;
1010import { delay } from 'bluebird' ;
11+ import { adminTestUser } from '@kbn/test' ;
1112import { getStateAndNonce } from '../../../fixtures/oidc/oidc_tools' ;
1213import { FtrProviderContext } from '../../../ftr_provider_context' ;
1314
1415export default function ( { getService } : FtrProviderContext ) {
1516 const supertest = getService ( 'supertestWithoutAuth' ) ;
16- const config = getService ( 'config' ) ;
1717
1818 describe ( 'OpenID Connect authentication' , ( ) => {
1919 it ( 'should reject API requests if client is not authenticated' , async ( ) => {
2020 await supertest . get ( '/internal/security/me' ) . set ( 'kbn-xsrf' , 'xxx' ) . expect ( 401 ) ;
2121 } ) ;
2222
2323 it ( 'does not prevent basic login' , async ( ) => {
24- const [ username , password ] = config . get ( 'servers.elasticsearch.auth' ) . split ( ':' ) ;
2524 const response = await supertest
2625 . post ( '/internal/security/login' )
2726 . set ( 'kbn-xsrf' , 'xxx' )
2827 . send ( {
2928 providerType : 'basic' ,
3029 providerName : 'basic' ,
3130 currentURL : '/' ,
32- params : { username, password } ,
31+ params : { username : adminTestUser . username , password : adminTestUser . password } ,
3332 } )
3433 . expect ( 200 ) ;
3534
@@ -42,10 +41,10 @@ export default function ({ getService }: FtrProviderContext) {
4241 . set ( 'Cookie' , request . cookie ( cookies [ 0 ] ) ! . cookieString ( ) )
4342 . expect ( 200 ) ;
4443
45- expect ( user . username ) . to . eql ( username ) ;
44+ expect ( user . username ) . to . eql ( adminTestUser . username ) ;
4645 expect ( user . authentication_provider ) . to . eql ( { type : 'basic' , name : 'basic' } ) ;
4746 expect ( user . authentication_type ) . to . be ( 'realm' ) ;
48- // Do not assert on the `authentication_realm`, as the value differes for on-prem vs cloud
47+ // Do not assert on the `authentication_realm`, as the value differs for on-prem vs cloud
4948 } ) ;
5049
5150 describe ( 'initiating handshake' , ( ) => {
0 commit comments