Filter multiple type of connections

Hello

On the documentation it is written that you can filter multiple strategies array[string] but I am not able to find a way to use this params. I tried array of string, string with multiple words separated with by commas, etc.

On ruby-auth0 and php implementation array of string is not documented and it doesn’t is it possible to use it to.

Regards

Hi @benoit.tigeot,

Thanks for reaching out. I would like to confirm the behavior. Can you please provide the endpoint this is in regards to or request you are attempting to make?

Hello Dan

This is from Get all connections

Screenshot 2021-12-02 at 14.29.56

1 Like

I think the explorer has a bug, as I wasn’t able to get anything to work in that input field.

Otherwise, I was able to get this to work with a cURL command. Here is how I formatted the params (e.g. filtering for auth0 and facebook strategies):

/api/v2/connections?strategy=auth0&strategy=facebook

I’ll create a bug report internally for the explorer. As for the ruby-auth0 package, does this solve that or would it still be an issue?

Hello Dan

Thanks for your answer.
For Ruby sadly it is only one field accepted. See ruby-auth0/connections.rb at master · auth0/ruby-auth0 · GitHub

There is a limitation with Ruby hash were you cannot have duplicated key. But with an array you can trick it.

It works if you do

auth0_client.get(connection_path, [['strategy', 'xxxx'],['strategy','zzzz']]) }
1 Like

Thanks for posting that workaround!

I alerted the team that the API is accepting the parameters this way (it is inconsistent with how some of the other endpoints accept arrays) and it has been added as a item to our backlog.

As for the ruby SDK, the best way to request a change would be through a GitHub issue or by creating a PR with a fix. If you are not able to create a GitHub issue, please let me know and I will create one.

1 Like

Issue on ruby-auth0 Unable to fetch connections with multiple strategy with current implementation · Issue #309 · auth0/ruby-auth0 · GitHub

1 Like

That looks perfect. Thank you!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.