johnbrett / hapi-auth-bearer-token

Simple Bearer authentication scheme plugin for hapi, accepts token by Header, Cookie or Query parameter.
MIT License
218 stars 46 forks source link

Expose the bearer token validator to the server? #77

Closed jonathansamines closed 8 years ago

jonathansamines commented 8 years ago

Hey thanks for this incredible plugin, I was wondering if it was possible to expose the validator logic to the hapi server. I have found useful to extend this module functionality for example with token validation functionality, to move all the token validation away into a plugin. Bell already does that.

What do you think? I can help with that if it is something that makes sense for you.

johnbrett commented 8 years ago

Hey @jonathansamines, that sounds like a cool idea, and shouldn't need much work. Where would you see yourself using it?

To make the update will need to update:

jonathansamines commented 8 years ago

@johnbrett sorry for the delay, I´m currently dealing with a custom token-validation logic, which uses the bearer token scheme, so I was trying to use this plugin as part of other plugin, to validate the bearer-token format and then use my custom logic in the other plugin.

It seems like hapi doesn´t support multi-step authentication strategies, so the only way to combine multiple strategies together is by exposing that kind of interface.

johnbrett commented 8 years ago

Hey @jonathansamines, sorry for the delay myself this time. That makes sense. Do you want to try put together a PR for this and we can work through it ?

johnbrett commented 8 years ago

Hey @jonathansamines - haven't had any activity on this a while so will close it. If you want to work further on this, feel free to re-open - happy to work on it with you.