Discovery Service JSON

The Discovery Service JSON file is primary used for Discovery services to show information about the SP and IdP when selecting an IdP. But the information can be useful for other use-cases aswell. Please not that the JSON file includes data for both SWAMID and inter-federations. 

Please note that if an entity is both an IdP and a SP (like for ADFS) the entity will show up as type: idp.

Here is an example of listing all scopes for the IdPs registered in SWAMID with curl and jq.

curl -s | jq '.[] | select ( .registrationAuthority == "" and .type == "idp" ) | "\(.scope) \(.entityID)"'

And an example with python doing the same.

#!/usr/bin/env python3
import urllib.request, json
with urllib.request.urlopen("") as url:
  data = json.load(url)
  for entity in data:
    if ('type' in entity and 'registrationAuthority' in entity and entity['type'] == 'idp' and entity['registrationAuthority'] == '') :
      if ('scope' in entity):
        scope = entity['scope']
        scope = 'Missing'
      print("%s %s" % (scope, entity['entityID']))

  • No labels