Source:
public static void loginOnBehalf ( javax.servlet.http.HttpServletRequest request , java.lang.String username ) throws java.lang.Exception { org.ovirt.engine.core.sso.utils.AuthenticationUtils.log.debug ( "Entered AuthenticationUtils.loginOnBehalf" ) ; int index = username.lastIndexOf ( "@" ) ; java.lang.String profile = null ; if ( index != ( - 1 ) ) { profile = username.substring ( ( index + 1 ) ) ; username = username.substring ( 0 , index ) ; } if ( ( org.apache.commons.lang.StringUtils.isEmpty ( username ) ) || ( org.apache.commons.lang.StringUtils.isEmpty ( profile ) ) ) { throw new org.ovirt.engine.core.sso.utils.AuthenticationException ( "Please provide username and profile." ) ; } org.ovirt.engine.core.sso.utils.AuthenticationUtils.login ( request , new org.ovirt.engine.core.sso.utils.Credentials ( username , null , profile , org.ovirt.engine.core.sso.utils.SSOUtils.getSsoContext ( request ) . getSsoProfiles ( ) . contains ( profile ) ) , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Authn.AuthRecord.PRINCIPAL , username ) ) ; }

Target:
public static void loginOnBehalf ( javax.servlet.http.HttpServletRequest request , java.lang.String username ) throws java.lang.Exception { org.ovirt.engine.core.sso.utils.AuthenticationUtils.log.debug ( "Entered AuthenticationUtils.loginOnBehalf" ) ; int index = username.lastIndexOf ( "@" ) ; java.lang.String profile = null ; if ( index != ( - 1 ) ) { profile = username.substring ( ( index + 1 ) ) ; username = username.substring ( 0 , index ) ; } if ( ( org.apache.commons.lang.StringUtils.isEmpty ( username ) ) || ( org.apache.commons.lang.StringUtils.isEmpty ( profile ) ) ) { throw new org.ovirt.engine.core.sso.utils.AuthenticationException ( "Please provide username and profile." ) ; } org.codehaus.jackson.map.ObjectMapper mapper = new org.codehaus.jackson.map.ObjectMapper ( ) . configure ( DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES , false ) . enableDefaultTyping ( ObjectMapper.DefaultTyping.OBJECT_AND_NON_CONCRETE ) ; mapper.getDeserializationConfig ( ) . addMixInAnnotations ( org.ovirt.engine.api.extensions.ExtMap.class , org.ovirt.engine.core.sso.utils.JsonExtMapMixIn.class ) ; java.lang.String authRecordJson = org.ovirt.engine.core.sso.utils.SSOUtils.getRequestParameter ( request , SSOConstants.HTTP_PARAM_AUTH_RECORD , "" ) ; org.ovirt.engine.api.extensions.ExtMap authRecord ; if ( org.apache.commons.lang.StringUtils.isNotEmpty ( authRecordJson ) ) { authRecord = mapper.readValue ( authRecordJson , org.ovirt.engine.api.extensions.ExtMap.class ) ; } else { authRecord = new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Authn.AuthRecord.PRINCIPAL , username ) ; } org.ovirt.engine.core.sso.utils.SSOSession ssoSession = org.ovirt.engine.core.sso.utils.AuthenticationUtils.login ( request , new org.ovirt.engine.core.sso.utils.Credentials ( username , null , profile , org.ovirt.engine.core.sso.utils.SSOUtils.getSsoContext ( request ) . getSsoProfiles ( ) . contains ( profile ) ) , authRecord ) ; org.ovirt.engine.core.sso.utils.AuthenticationUtils.log.info ( "User {}@{} successfully logged in using login-on-behalf with client id : and scopes : {}" , username , profile , ssoSession.getClientId ( ) , ssoSession.getScope ( ) ) ; }