Comments (5)
By setting the environment variable HTTP_TOKENINFO_URL
(or x-tokenInfoUrl
on the security definition) you will simply enable the security decorator which will request the given HTTP URL with an access_token
parameter filled with the Bearer
token (https://github.com/zalando/connexion/blob/master/connexion/decorators/security.py#L64) and extracts the JSON response. The JSON response must contain the fields scope
and uid
(e.g. username).
I'm not familiar with standard security mechanisms in Flask, but you can always simply decorate your function with a custom function to do security checking. You can find a simple example here: http://flask.pocoo.org/snippets/8/
from connexion-example.
@KarimJedda I added a very simple example of HTTP Basic Auth here: https://github.com/zalando/connexion/tree/master/examples/basicauth
from connexion-example.
@KarimJedda I also added a simple OAuth2 resource server example with a mock token info endpoint: https://github.com/zalando/connexion/tree/master/examples/oauth2
from connexion-example.
@KarimJedda obviously I would like to see your published blog post 😄
Don't hesitate to ask/contact if you need any further support. Thanks!
from connexion-example.
Wow @hjacobs, I wasn't expecting such a wonderful and detailled answer, thanks a lot !!! I will try it out right away. Really man you're doing some awesome job with this!
Sure thing, you'll be the first to know when it's done ;)
thanks again!!
from connexion-example.
Related Issues (9)
- Path parameters converted to integers
- How to do I enable cross-domain requests? HOT 2
- support for Python 2.7.x? HOT 2
- Thanks HOT 1
- Thank you very much! HOT 3
- Add example Dockerfile with Alpine Linux base image and gevent
- Default values for animal fields HOT 5
- I am trying to use your framework to test api with my specifications. but getting the error.
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 connexion-example.