signalpoint / jDrupal

A JavaScript Library and API for Drupal Applications
http://jdrupal.tylerfrankenstein.com/
GNU General Public License v2.0
76 stars 38 forks source link

OAuth2 token bearer authentication #36

Open kentr opened 8 years ago

kentr commented 8 years ago

I'm looking for a way to use OAuth2 token bearer authentication (with the D8 branch, if it matters).

I don't see any Authorization header in the code, so I'm guessing this isn't currently supported.

Do you know of any jDrupal modules which add the header via hook_rest_pre_process? Or is there a list of existing modules somewhere?

signalpoint commented 8 years ago

@kentr The only true jDrupal module is DrupalGap, and then a ton of modules built on top of DrupalGap. It's still possible to make modules for jDrupal, but to my knowledge that hasn't ever been done (except for DrupalGap of course).

As you've noticed, there is no Authorization header support built into jDrupal, as it currently just falls back to session/cookie data. I don't know much about OAuth2, but I'd be happy to lend help making this a reality within jDrupal.

For starters, if you just need to add an Authorization header, then I think hook_rest_pre_process would be the place to do it.