How to properly secure a swagger API to be used with mobile devices?

I’m trying to use the swagger node to build an API to my meteor app. I managed to build the API but could not find a good guide on how to secure it. The plan is to let our mobile app connect to the main app in the server. (For this we also need to generate device-specific keys right?)

So far we tried to setup security in swagger like this :

securityDefinitions:
    oauth2:
    type: oauth2
    authorizationUrl: "http://swagger.io/api/oauth/dialog"
    flow: "implicit"
security:
    - oauth2: []

But it gave us this error:

{
    "message": "unknown security handler: oauth2",
    "code": "server_error",
    "statusCode": 403
}

Can you please tell me why the error is coming and how to properly implement the API according to my needs? Thanks!

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