try {
  def user = inargs['UserID'] ?: session['ch.adnovum.nevisidm.user.extId'] ?: 'unknown'
  def techuser = session['agov.techuser.extId'] ?: 'unknown'
  def sourceIp = request.getTransportLayerInformation().getRemoteIP() ?: 'unknown'
  def credentialType = request.getResource().replaceAll("\\/nevisauth\\/services\\/sts\\/(.+)\\/", "\$1").toUpperCase()
  
  if (credentialType=='SAML') {
    credentialType = 'PASSWORD'
  }
  LOG.info("Event='TKNISSUED', Techuser=${techuser}, User=${user}, CredentialType='${credentialType}', SourceIp=${sourceIp}")
  
} catch (Exception e) {
  LOG.warn("Exception in Script: ${e}")
} finally {
  response.setResult('ok')
}