Show required OAuth scopes on each endpoint
See original GitHub issueThe API I am documenting has a lot of scopes available. However, a single endpoint usually only requires one scope. Currently a padlock is displayed on each endpoint and clicking it opens the Available authorizations modal where all scopes the API has are displayed.
It would be great to know which individual scopes are required per endpoint.
I have checked my source swagger json and this information is there on a per endpoint basis. Here is a subset of my swagger json to show the relevant sections:
{
"swagger": "2.0",
"info": {
"description": "Api Documentation",
"version": "1.0",
"title": "Api Documentation",
"termsOfService": "urn:tos",
"contact": {},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0"
}
},
"paths": {
"/v1/organisations/{id}": {
"get": {
"summary": "Get a single Organisation",
"operationId": "getByIdUsingGET",
"security": [
{
"Auth0": [
"get:organisation"
]
}
],
"deprecated": false
}
}
},
"securityDefinitions": {
"Auth0": {
"type": "oauth2",
"tokenUrl": "https://xxxxxxxxx/oauth/token",
"flow": "application",
"scopes": {
"create:organisation": "Create an Organisation",
"get:organisation": "Get a single Organisation",
"list:organisation": "List Organisations",
"update:organisation": "Update an Organisations",
"delete:organisation": "Delete an Organisations",
}
}
}
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:61
- Comments:11 (1 by maintainers)
Top Results From Across the Web
Show required OAuth scopes on each endpoint in swagger for ...
Currently getting all scopes the API has However wants to display each endpoint is providing what scopes authorize for it.
Read more >OAuth Scopes Best Practices | Curity
Best practices for designing OAuth scopes in real world systems and managing them at scale. Discover how to perform API Authorization using Scopes....
Read more >How to manage OAuth 2.0 scopes - Connect2id
Give a name space for the scopes for each protected resource -- To make sure the scope values for two different resources don't...
Read more >OAuth 2.0 Scopes for Google APIs | Authorization
This document lists the OAuth 2.0 scopes that you might need to request to access Google APIs, depending on the level of access...
Read more >API Scopes - Auth0
An application can include any scope defined for an API in its request. Instead of allowing all available scopes to be requested, however,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is there any chances to get this functionality in future?
We came up with a plugin that do the job well enough for us: