cancel
Showing results for 
Search instead for 
Did you mean: 
cancel

Who Me Too'd this topic

Duo /admin/v2/integrations API Call Not Working

pwilliams-ck
Level 1
Level 1

@Duo @DuoSecurity

We are trying to figure out why calling /admin/v1/integrations via the official Golang API client works, but /admin/v2/integrations does not. Unfortunately, Duo support staff are struggling to help. Does anyone have experience, or an example (in any programming language) of this working? More details below, thanks in advance.

We have the Golang API client connected to our internal API we are building, we are able to get users and integrations from v1 endpoints but we are struggling with 40103 errors when using /admin/v2/integrations endpoints.


This is a working code snippet, how do I change this to work with v2 endpoints? This is set up nearly identical to the user and group methods in the Golang API client repo Duo recommends to use.


func (c *Client) GetIntegrations(options ...func(*url.Values)) (*GetIntegrationsResult, error) {
params := url.Values{}
for _, o := range options {
o(&params)
}

cb := func(params url.Values) (responsePage, error) {
return c.retrieveIntegrations(params)
}
response, err := c.retrieveItems(params, cb)
if err != nil {
return nil, err
}

return response.(*GetIntegrationsResult), nil
}

func (c *Client) retrieveIntegrations(params url.Values) (*GetIntegrationsResult, error) {
_, body, err := c.SignedCall(http.MethodGet, "/admin/v1/integrations", params, UseTimeout)
if err != nil {
return nil, err
}

result := &GetIntegrationsResult{}
err = json.Unmarshal(body, result)
if err != nil {
return nil, err
}
return result, nil
}
 
We do not understand what is wrong. This works with v1, but not v2. Other user and group methods seem to work either way.
 
I also noticed this in the duosecurity/duo_client_python/duo_client/admin.py, on line 2595. Is this perhaps why it is not working? We need to use SSO params in the call so v2 is required.

        sso - <dict: parameters for generic single sign-on> (optional)
                New argument for unreleased feature. Will return an error if used.
                Client will be updated again in the future when feature is released.
Who Me Too'd this topic