Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

SAV4SAV Rest connector

Mortal
Regular Contributor
Regular Contributor

Hi,

I am working on the use case for the sav4sav connector and the use case is I need to configure the importaccountentjson so the account type should get updated to the service account after importing the data through sav4sav. For example, I have AD accounts and through analytics, I'm accessing the account data so If firstname=xyz then account type = service account. For analytics, should I create it with SQL query/ data query/ runtime analytics? I have mentioned the ImportAccountEntJSON

{
  "accountParams": {
    "connection": "accAuth",
    "processingType": "SequentialAndIterative",
    "statusAndThresholdConfig": {
      "accountThresholdValue": 50,
      "statusColumn": "status",
      "activeStatus": [
        "1"
      ],
      "deleteLinks": false,
      "accountsNotInImportAction": "Suspend"
    },
    "call": {
      "call1": {
        "callOrder": 0,
        "stageNumber": 0,
        "http": {
"url": "https://xyz.com/ECM/api/v5/fetchRuntimeControlsData",
"httpParams": "{\"analyticsname\": \"AccountImport\"}",
          "httpMethod": "GET",
          "httpHeaders": {
            "Authorization": "${access_token}",
            "Accept": "application/json"
          },
          "httpContentType": "application/json"
        },
        "listField": "result",
        "keyField": "accountID",
        "colsToPropsMap": {
          "accountID": "AccountID~#~char",
          "name": "AccountName~#~char",
          "status": "status1~#~char"
        }
      }
    }
  },
"entitlementParams": {},
"acctEntParams": {}
}

 

18 REPLIES 18

pmahalle
All-Star
All-Star

Hi @Mortal ,

Make sure to add one more column in you query which will define the type of account based on your firstname condition as you mentioned about and map that column to accountType in your  importaccountentjson  like below.

{
  "accountParams": {
    "connection": "accAuth",
    "processingType": "SequentialAndIterative",
    "statusAndThresholdConfig": {
      "accountThresholdValue": 50,
      "statusColumn": "status",
      "activeStatus": [
        "1"
      ],
      "deleteLinks": false,
      "accountsNotInImportAction": "Suspend"
    },
    "call": {
      "call1": {
        "callOrder": 0,
        "stageNumber": 0,
        "http": {
"url": "https://xyz.com/ECM/api/v5/fetchRuntimeControlsData",
"httpParams": "{\"analyticsname\": \"AccountImport\"}",
          "httpMethod": "GET",
          "httpHeaders": {
            "Authorization": "${access_token}",
            "Accept": "application/json"
          },
          "httpContentType": "application/json"
        },
        "listField": "result",
        "keyField": "accountID",
        "colsToPropsMap": {
          "accountID": "AccountID~#~char",
          "name": "AccountName~#~char",
          "accountType":"AccountType~#~char",
          "status": "status1~#~char"
        }
      }
    }
  },
"entitlementParams": {},
"acctEntParams": {}
}

 


Pandharinath Mahalle(Paddy)
If this reply helps your question, please consider selecting Accept As Solution and hit Kudos 🙂

Mortal
Regular Contributor
Regular Contributor

@pmahalle what should be the condition and where do we need to put it?

hi @Mortal create the analytics as a runtime analytics query. 

Also. if you requirement is to just update the account type based on a condition, you can also use enhanced query execution in which case, the savForSav is not required. 

 

Regards,
Naveen Sakleshpur
If this reply answered your question, please click the Accept As Solution button to help future users who may have a similar problem.

@Mortal In you analytics query. Provide your query here.


Pandharinath Mahalle(Paddy)
If this reply helps your question, please consider selecting Accept As Solution and hit Kudos 🙂

@Mortal ,

As mentioned by Naveen If you want to just change the account type of accounts then you can use enhanced query for that rather that SAV4SAV.  Below is the sample enhanced query which will set account type as service account for account's having customproperty1 start with string first.

select accountkey as accounts__primarykey,case when customproperty1 like '%first%' then 'Service Account' else null end as accounts__accounttype from accounts where customproperty1 is not null limit 1;


Pandharinath Mahalle(Paddy)
If this reply helps your question, please consider selecting Accept As Solution and hit Kudos 🙂

Mortal
Regular Contributor
Regular Contributor

@naveenss @pmahalle We cannot perform this action with an enhance query because there might be multiple service accounts that why we are trying with the sav4sav connector. 

Currently I was trying with one account and I created runtime analytics as for this the query as follows:

select a.accountkey, a.accountID, a.name, a.status as status1, 'Service Account' as accounttype FROM ACCOUNTS A, ENDPOINTS E WHERE A.ENDPOINTKEY = E.ENDPOINTKEY and e.ENDPOINTKEY=5 and a.status IN (1,'active') and a.accountkey =1613962

I am getting the result from above query but the job is failing with error msg Failed url-https://xyz/ECM/api/v5/fetchRuntimeControlsDataV2 with Error Message-null and in log viewer 

org.joda.time.IllegalFieldValueException: Value 24 for hourOfDay must be in the range [0,23] at org.joda.time.field.FieldUtils.verifyValueBounds(FieldUtils.java:234) at org.joda.time.field.PreciseDateTimeField.set(PreciseDateTimeField.java:112) at org.joda.time.chrono.BaseChronology.getDateTimeMillis(BaseChronology.java:163) at org.joda.time.chrono.AssembledChronology.getDateTimeMillis(AssembledChronology.java:151) at org.joda.time.chrono.AssembledChronology.getDateTimeMillis(AssembledChronology.java:148) at org.joda.time.LocalTime.<init>(LocalTime.java:506) at org.joda.time.LocalTime.<init>(LocalTime.java:450) at net.redhogs.cronparser.DateAndTimeUtils.formatTime(DateAndTimeUtils.java:57) at net.redhogs.cronparser.DateAndTimeUtils.formatTime(DateAndTimeUtils.java:26) at net.redhogs.cronparser.builder.HoursDescriptionBuilder.getSingleItemDescription(HoursDescriptionBuilder.java:23) at net.redhogs.cronparser.builder.AbstractDescriptionBuilder.getSegmentDescription(AbstractDescriptionBuilder.java:28) at net.redhogs.cronparser.CronExpressionDescriptor.getHoursDescription(CronExpressionDescriptor.java:174) at net.redhogs.cronparser.CronExpressionDescriptor.getTimeOfDayDescription(CronExpressionDescriptor.java:220) at net.redhogs.cronparser.CronExpressionDescriptor.getFullDescription(CronExpressionDescriptor.java:241) at net.redhogs.cronparser.CronExpressionDescriptor.getDescription(CronExpressionDescriptor.java:62) at net.redhogs.cronparser.CronExpressionDescriptor.getDescription(CronExpressionDescriptor.java:39) at com.saviynt.ecm.utility.domain.FlatViewJobcontrolController$_closure5_closure78.doCall(FlatViewJobcontrolController.groovy:335) at com.saviynt.ecm.utility.domain.FlatViewJobcontrolController$_closure5.doCall(FlatViewJobcontrolController.groovy:314) at grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter.doFilter(GrailsAnonymousAuthenticationFilter.java:53) at com.saviynt.webservice.SaviyntRestAuthenticationFilter.doFilter(SaviyntRestAuthenticationFilter.groovy:159) at grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter.doFilter(MutableLogoutFilter.java:62) at grails.plugin.springsecurity.web.SecurityRequestHolderFilter.doFilter(SecurityRequestHolderFilter.java:59) at com.mrhaki.grails.plugin.xframeoptions.web.XFrameOptionsFilter.doFilterInternal(XFrameOptionsFilter.java:69) at com.brandseye.cors.CorsFilter.doFilter(CorsFilter.java:82) at java.lang.Thread.run(Thread.java:750)

Error is not related to job


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Mortal
Regular Contributor
Regular Contributor

@rushikeshvartak , Sorry for sharing an invalid error. I've attached the log file of the error.

You have issue with connection JSON


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Mortal
Regular Contributor
Regular Contributor

@rushikeshvartak ,

currently following connection JSON in use. Is that issue referring to the URL by any chance? Or do I need to add some additional fields to it?

{
  "authentications": {
    "userAuth": {
      "authType": "oauth2",
      "url": "xyz.com/ECM/api/login",
      "httpMethod": "POST",
      "httpParams": "{\"username\": \"abc\",\"password\": \"abc\"}",
      "httpContentType": "application/json",
      "httpHeaders": {
        "Content-Type": "application/json"
      },
      "authError": [
        "USER_AUTHENTICATION_FAILED",
        "PARTNER_AUTHENTICATION_FAILED",
        "AuthenticationFailed"
      ],
      "errorPath": "errorCode",
      "maxRefreshTryCount": 5,
      "tokenResponsePath": "access_token",
      "tokenType": "Bearer",
      "authHeaderName": "Authorization",
      "accessToken": "Bearer abcd",
      "retryFailureStatusCode": [
        401
      ]
    }
  }
}

 

Your connection name in connection json is 

userAuth

and in account import acctAuth 

Make it consistent 


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Mortal
Regular Contributor
Regular Contributor

@rushikeshvartak ,

even after making it consistent on both sides, still getting errors and for the job getting an error message is null Screenshot 2024-07-05 102045.png

Share logs


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Mortal
Regular Contributor
Regular Contributor

@rushikeshvartak I figured out the issue for the SAV4SAV, for the URL there is SSO present and because of this, I could not make API calls. I changed the URL which does not have SSO enabled and now the job is successful but I was unable to update the account type as a service account using the below query

select a.accountkey, a.accountID, a.name, a.status as status1, 'Service Account' as accounttype FROM ACCOUNTS A, ENDPOINTS E WHERE A.ENDPOINTKEY = E.ENDPOINTKEY and e.ENDPOINTKEY=5 and a.status IN (1, 'active') and a.accountkey =1613962

@Mortal , Try below query in your enhanced query job.

select a.accountkey as accounts__primarykey, 'Service Account' as accounts__accounttype FROM ACCOUNTS A, ENDPOINTS E WHERE A.ENDPOINTKEY = E.ENDPOINTKEY and e.ENDPOINTKEY=5 and a.status IN (1, 'active') and a.accountkey =1613962


Pandharinath Mahalle(Paddy)
If this reply helps your question, please consider selecting Accept As Solution and hit Kudos 🙂

select a.accountkey as accounts__primarykey,

, 'Service Account' as accounts__accounttype FROM ACCOUNTS a where a.accountkey =1613962


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

NM
Honored Contributor II
Honored Contributor II

Hi @Mortal , share updated importaccountentjson

Mortal
Regular Contributor
Regular Contributor

@NM  currently using the following ImportAccountEntJSON 

{
  "accountParams": {
    "connection": "userAuth",
    "processingType": "SequentialAndIterative",
    "statusAndThresholdConfig": {
      "statusColumn": "status",
      "activeStatus": [
        1
      ],
      "deleteLinks": false,
      "accountThresholdValue": 10000,
      "correlateInactiveAccounts": false,
      "inactivateAccountsNotInFile": false,
      "deleteAccEntForActiveAccounts": false
    },
    "call": {
      "call1": {
        "callOrder": 0,
        "stageNumber": 0,
        "http": {
          "url": "xyz.com/ECM/api/v5/fetchControlDetailsES?analyticsid=1489",
          "httpHeaders": {
            "Authorization": "${access_token}",
            "Accept": "application/json"
          },
          "httpContentType": "application/json",
          "httpMethod": "GET"
        },
        "listField": "results",
        "keyField": "accountID",
        "colsToPropsMap": {
          "accountkey": "AccountKey~#~char",
          "accountID": "AccountID~#~char",
          "name": "AccountName~#~char",
          "status": "active~#~char",
         "accounttype":"AccountType~#~char"
        }
      }
    }
  },
  "entitlementParams": {},
  "acctEntParams": {}
  }