Comments (8)
@leranjun Keep in mind that Swagger is just documentation of your application nothing more, Swagger is just so simple front-end application for your backend application where you can visualize your endpoints. There is no "Swagger Api". Regarding the documentation, I will try soon as possible to add one on how it works. Also, we manage to create awesome integration with the URM application(User Rights Management). Where we are getting the authentication from Azure via this project and after that, we are sending the token to the URM. In this way, we are able to check which user have permission for specific endpoints (Permissions from centralized application)
from fastapi-azure-auth.
Gotcha, super helpful! I think I'll need to dig a bit deeper into what I actually want to achieve. Thank you both for the comments.
from fastapi-azure-auth.
I'll close this for now. Please don't hesitate re-opening or creating a new issue if you have more questions, @leranjun
from fastapi-azure-auth.
Unfortunately the documentation for B2C is lacking. @kristiqntashev added tests and support - would you be up to document Azure setup too? Or you, @leranjun if you made it work?
As for APIs to be restricted, you should use roles in Azure. There's docs on how to do that here.
from fastapi-azure-auth.
Thanks for the reply! Is it possible for only the Swagger docs to be restricted, though? Or does it only apply to main API routes? I don't seem to see a dependency configuration for docs.
from fastapi-azure-auth.
Swagger is just a client to call your APIs, there's no "swagger API" and "normal API". So if I interpret your question correctly, and you want to hide swagger docs behind authentication, then no, that's not possible (and would be security by obscurity, which is pretty useless). Your APIs should have authentication, and swagger is just a client that can call your APIs, and help you fetch a valid token.
from fastapi-azure-auth.
Of course you can always host a custom swagger, or customize the one fastapi generates, but there's no security in that.
See https://fastapi.tiangolo.com/advanced/extending-openapi/.
from fastapi-azure-auth.
@kristiqntashev that sounds awesome! Let me know if you need any help with docs! 😊
from fastapi-azure-auth.
Related Issues (20)
- [Feature request] Accept both token versions HOT 6
- [Question] Implementation on Azure API Management HOT 3
- [Feature request] Docs On How to set up AAD B2C HOT 10
- Wrong access token required claims HOT 2
- OpenAPI schema with FastAPI >= 0.99.0 HOT 2
- [Feature request] HOT 1
- Validating extension attributes for managing user roles in B2C HOT 3
- Multiple Scopes HOT 3
- [Feature request] support Pydantic v2 syntax / @validator -> @field_validator HOT 5
- [BUG/Question] Fixing TypeError during WebSocket Authentication Migration from FastAPI 0.96 to 0.97 HOT 8
- Calling your APIs from Python not working HOT 22
- [Question] Middleware logging does not get request.state.user HOT 2
- Make leeway a setting available for configuration
- [Question] HOT 6
- [BUG/Question] auth_time is parsed as a string, should be int HOT 2
- [BUG/Question] Got 'Token contains invalid claims' error for the `single tenant setup example ` HOT 6
- [Question] Validate bearer token from Angular SPA (Azure AD) in FastAPI HOT 4
- [BUG/Question] Error calling openid_config.load_config with Httpx 0.25.1 HOT 4
- [Bug/Question] HOT 2
- Adding new fields for Client Secret JWT HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastapi-azure-auth.