Does the Pipedream Advanced Plan Include ADP Integration?

Yea, the cert and key will be accessible like this:

cert: this.adp.$auth.crt_file,
key: this.adp.$auth.key_file

This is the basic code scafflding we have configured, but again, we’ve never been able to test it end to end in this case:

import { axios } from "@pipedream/platform"
import https from "https"

export default defineComponent({
  props: {
    adp: {
      type: "app",
      app: "adp",
    }
  },
  async run({steps, $}) {
    const httpsAgent = new https.Agent({
      cert: this.adp.$auth.crt_file,
      key: this.adp.$auth.key_file,
    })

    return await axios($, {
      url: `${this.adp.$auth.environment}[api.adp.com/hr/v2/workers](http://api.adp.com/hr/v2/workers)`,
      headers: {
        Authorization: `Bearer ${this.adp.$auth.oauth_access_token}`,
      },
      httpsAgent: httpsAgent
    })
  },
})

just requested and it failed

I saw that, try again

Failed

I’m sure it’s coming, but if I could also request a python version of the current Node.js ADP built-in action :slightly_smiling_face:

Can you refresh the page and try again?

Still failing

Yea, different errors now though, so we’re getting somewhere. I see this now:

{
  "error": "invalid_request",
  "error_description": "proper client ssl certificate was not presented"
}

Hmm okay. I’m using the exact same info through env vars in a working custom python action

This is the access token request that we’re sending when you connect an account:

> method: POST

> uri: https://accounts.adp.com/auth/oauth/v2/token

> headers: {"accept-encoding"=>["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"], "accept"=>["application/json"], "user-agent"=>["Ruby"], "host"=>["[accounts.adp.com](http://accounts.adp.com)"], "content-type"=>["application/x-www-form-urlencoded"], "authorization"=>["Basic xxx"]}

> body: grant_type=client_credentials

Where the Basic credentials are base64 encoded client_id:client_secret

Does that look right based on your testing?

according to ADP they need to be x-www-url-encoded body

[requests.post](http://requests.post)(
    URL + OAUTH_URI,
    cert=(cert_path, key_path),
    headers={
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data={
      'client_id': client_id,
      'client_secret': client_secret,
      'grant_type': grant_type
    },
    verify=True
  )

python example

Oh that’s a different auth implementation

Sending the credentials in the body, let’s try that

where grant_type is client_credentials

Okay, can you try again?

it may not matter, as I’ve seen both in ADP docs, but my URL in the python example is https://api.adp.com, you all are using [https.accounts.adp.com](http://https.accounts.adp.com). Again it may not matter, but just to shout it out

Might have to refresh the page?