Files
docs/articles/hubs/oauth.md
Robert Wallach 78b4477ab4 Create oauth for Hubs.md (#178)
* Create oauth.md

* Update oauth.md

* Update oauth.md

* Update oauth.md
2018-04-11 15:40:34 -05:00

1.6 KiB

OAuth for Hubs

What

OAuth provides a level of security to your documentation to restrict access to it. Enabling OAuth in Hubs can be accomplished through two different methods: via Modeling or directly into the Hubs code.

Stoplight supports OAuth 1.0 and 2.0

How

Modeling

OAuth in Modeling

  1. Create a new Modeling file or select an existing one referenced by the Hub you wish to modify

If you are creating a new Modeling file, make sure to reference it in your Hub

  1. Next to Security in the left-middle toolbar, Add a Security Scheme by clicking the +
  2. Input a key
  3. Select oauth2 under type
  4. Select accessCode under OAuth flow
  5. Select an authorization url
  6. Select a token url
  7. Add Scope (optional)
  8. Add a Security scheme description (optional)

Hubs

OAuth in Hubs

  1. Select the Hub you wish to modify
  2. Select Code View
  3. Add the following lines of code to your Hub:

"config": {
  "http": {
    "oauth2": {
      "credentials": {
        "authorize_url": "insert authorize url here",
        "access_token_url": "insert access token url here",
      }
    }
  }
}


Related Articles