Giter Site home page Giter Site logo

HMAC Authentication Plugin about httplug HOT 4 CLOSED

rrajkomar avatar rrajkomar commented on May 27, 2024
HMAC Authentication Plugin

from httplug.

Comments (4)

dbu avatar dbu commented on May 27, 2024

you can always implement your own authentications and use them with the AuthenticationPlugin.

if you have a good implementation of HMAC it could be cool to add it to php-http/message in https://github.com/php-http/message/tree/master/src/Authentication. this depends a bit on how complicated HMAC is though - if it depends on other libraries or is otherwise complicated enough to need several classes, its better as a separate component.

you should be able to add more than one instance of the authentication plugin to a client: http://docs.php-http.org/en/latest/plugins/authentication.html - does that not work?

from httplug.

rrajkomar avatar rrajkomar commented on May 27, 2024

Hi, I know I can implement my own authentication class but I thought it'd be best not to have multiple versions of a authentication class that could be beneficial to all (much like wsse, hmac is a quite common authentication mechanism)

if you have a good implementation of HMAC it could be cool to add it to php-http/message in https://github.com/php-http/message/tree/master/src/Authentication. this depends a bit on how complicated HMAC is though - if it depends on other libraries or is otherwise complicated enough to need several classes, its better as a separate component.

I do have an implementation that I started working on but it is based on a custom class (in an external dependency) whose job is to sign and verify hmac requests (and it is not publicly available yet)

you should be able to add more than one instance of the authentication plugin to a client: http://docs.php-http.org/en/latest/plugins/authentication.html - does that not work?

Adding multiple mechanism is not the issue here, the issue is that if multiple mechanism add the same header (in this cas the Authorization header) I don't think you can use both authentication simultaneously

A simple example is to have an client app authentify itself using hmac and authentifying the end-user who made the request via a token : if both mechanism write to the same header at some point one is bound to overwrite the other and you can never use both at the same time to authentify both client app and end user.

from httplug.

dbu avatar dbu commented on May 27, 2024

same header

what do the standards say how multiple mechanisms should work? should we use withAddedHeader in our plugins so that authentications accumulate? would that not trip up some of the implementations?

hmac

i was afraid that hmac is not trivial. if this needs an encoder and possibly some crypto library or something, i think it should be a separate repository to not overload whats in php-http/message.

from httplug.

dbu avatar dbu commented on May 27, 2024

if someone did a hmac auth library for php-http, please add it in https://github.com/php-http/documentation/

from httplug.

Related Issues (20)

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.