Coder Social home page Coder Social logo

Comments (5)

hjacobs avatar hjacobs commented on July 4, 2024

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.

hjacobs avatar hjacobs commented on July 4, 2024

@KarimJedda I added a very simple example of HTTP Basic Auth here: https://github.com/zalando/connexion/tree/master/examples/basicauth

from connexion-example.

hjacobs avatar hjacobs commented on July 4, 2024

@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.

hjacobs avatar hjacobs commented on July 4, 2024

@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.

KarimJedda avatar KarimJedda commented on July 4, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.