Skip to content

Specs: Expanded providers

TheVinc edited this page Oct 22, 2014 · 1 revision

In the Specs: Provider's configuration, you can find a lot of defaults values and contractions. If you are not sure of one of them, you still can write it extended and let npm test tell you what you can compact (warnings).

If you want to see the full expended configuration, you can request {api_path}/providers/{your provider name}?extend=true

The main points are:

  • A {Request Object} can be compacted as its url string.
  • An url can be relative to the url in the root object.
  • If no {Parameters Object} is present, this will create a default client_id & client_secret key pair.
  • Take a look at the defaults values in Specs: Provider's configuration, you don't need to add a field it if it is already the default one.

Moreover there also are defaults object. If this matches entirely, you can omit it. Here are the list of these objects:

  • oauth2.authorize.query:
"query": {
    "client_id": "{client_id}",
    "response_type": "code",
    "scope": "{scope}",
    "redirect_uri": "{{callback}}",
    "state": "{{state}}"
}
  • oauth2.access_token.query:
"query": {
    "client_id": "{client_id}",
    "client_secret": "{client_secret}",
    "redirect_uri": "{{callback}}",
    "grant_type": "authorization_code",
    "code": "{{code}}"
}
  • oauth2.request.headers:
"headers": {
    "Authorization": "Bearer {{token}}"
}
  • oauth2.refresh:
"query": {
    "client_id": "{client_id}",
    "client_secret": "{client_secret}",
    "grant_type": "refresh_token",
    "refresh_token": "{{refresh_token}}"
}