From the course: Building APIs with Swagger and the OpenAPI Specification

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Security schemes

Security schemes - REST Tutorial

From the course: Building APIs with Swagger and the OpenAPI Specification

Start my 1-month free trial

Security schemes

- [Narrator] APIs can expose sensitive data and operations that we want to protect from unauthorized access. OAS provides us with a security scheme to define how an API is secured, so that we can protect those sensitive resources. Within SwaggerHub, we can use a template to easily define a security scheme. So let's create a new API definition, and within the dialogue box we want to make sure that it's Version 3.0 of the OAS spec that we're using. And then within the templates, you'll notice that we have several templates that are dedicated to providing security schemes for several OAuth flows. We're going to go ahead and pick the Password Flow, and at this point we're going to name our API the security template and we can go ahead and create it. Once the API is created, we're navigated into the editor, and if we scroll down to the bottom of this API definition, you can find the security scheme that was created within the template. The security scheme specifies that we're using OAuth…

Contents