How to use RAML to describe an API using OAuth2 [closed]
Asked Answered
C

1

14

I'm want to use RAML to describe an API using OAuth2

Does anyone have a solution or example I could use to compare with my own RAML for my api?

Clupeid answered 15/1, 2014 at 10:54 Comment(4)
Why was this closed?Clupeid
The close reason is prominently displayed above: Your question is off-topic since it requests an off-site resource.Vickivickie
@Vickivickie I asked for a solution and i got a popular answer! Is that not what this site is for?Clupeid
Every community has rules. I don't make these rules. I just pointed out the particular rule your question ran afoul of, hoping to answer your question.Vickivickie
M
12

From https://github.com/raml-org/raml-spec/blob/master/08_security.md#declaration:

securitySchemes:
    - oauth_2_0:
        description: |
            Dropbox supports OAuth 2.0 for authenticating all API requests.
        type: OAuth 2.0
        describedBy:
            headers:
                Authorization:
                    description: |
                       Used to send a valid OAuth 2 access token. Do not use 
                       with the "access_token" query string parameter.
                    type: string
            queryParameters:
                access_token:
                    description: |
                       Used to send a valid OAuth 2 access token. Do not use together with 
                       the "Authorization" header
                    type: string
            responses:
                401:
                    description: |
                        Bad or expired token. This can happen if the user or Dropbox
                        revoked or expired an access token. To fix, you should re-
                        authenticate the user.
                403:
                    description: |
                        Bad OAuth request (wrong consumer key, bad nonce, expired
                        timestamp...). Unfortunately, re-authenticating the user won't help here.
        settings:
          authorizationUri: https://www.dropbox.com/1/oauth2/authorize
          accessTokenUri: https://api.dropbox.com/1/oauth2/token
          authorizationGrants: [ code, token ]
Misread answered 15/1, 2014 at 17:8 Comment(1)
This is for raml 0.8 standard i suppose. what would a valid declaration look like for 1.0 ?Sanderson

© 2022 - 2024 — McMap. All rights reserved.