对Drupal 7的REST服务器基本HTTP认证 [英] Basic HTTP Authentication for REST Server on Drupal 7

查看:249
本文介绍了对Drupal 7的REST服务器基本HTTP认证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢这种感觉可能已经某处回答,但似乎没有人有直接回答这个问题,关于Drupal和我想知道如果可能使所有的差异。

I feel like this might be answered already somewhere, but no one seems to have answered this question directly about Drupal and I'm wondering if that might be making all the difference.

我已经建立了香草Drupal安装,只需使用REST服务器来处理推送通知必要的模块。在与CocoaRestClient测试REST服务器(在这里找到的http:// code.google.com / p /可可其余的客户端/ )我遇到与基本HTTP认证问题(验证失败)。我曾与会话验证测试和完美的作品。我的用户名和密码是最肯定是正确的。该服务基本身份验证模块并没有提供太多的设置的方式,所以我能怎么做错了?

I have setup a vanilla Drupal installation with just the necessary modules to use a REST server to handle Push Notifications. In testing the REST server with the CocoaRestClient (found here http://code.google.com/p/cocoa-rest-client/) I am encountering a problem with Basic HTTP Authentication (Authentication is failing). I have tested with Session Authentication and that works perfectly. My username and password are most certainly correct. The Services basic authentication module doesn't provide much in the way of setup, so what could I be doing wrong?

Modules being used:
Push Notifications
Services
Services basic authentication
REST Server

7.22 Drupal的最小(香草安装 - 没有主题或高于列出的其他任何花哨的模块)。

Drupal 7.22 minimal (vanilla install - no themes or any other fancy modules than the ones listed).

推荐答案

基本身份验证,您可以GET,POST,PUT和DELETE,以使用基本认证头端点。我不知道这是否会做的/登录结束点什么。授权头应基本遵循由基于-64连接的codeD字符串了'用户名:密码(不包括引号)。
授权:基本QWxhZGRpbjpvcGVuIHNlc2FtZQ ==

Basic auth enables you to GET, POST, PUT, and DELETE, to your endpoints using a Basic Auth Header. I am not sure if it will do anything for the /login end point. The authorization header should be made up of Basic followed by a based-64 encoded string of 'user:password' (not including the quotes). Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

您可以使用这个邮差或提琴手快速测试。

You can quickly test this using Postman or Fiddler.

这篇关于对Drupal 7的REST服务器基本HTTP认证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆