Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Authorisation for RESTful Webserivce


Go to End


1283 Views

Avatar
Silverfish

Community Member, 59 Posts

11 October 2012 at 1:21am

Edited: 11/10/2012 2:00am

Hi Everybody,

on Silverstripe 2.4.x, I'm trying to realize restful Webservice Access on one of the DataObjects of our Web-Project.

First part was pretty easy, just added

	static $api_access = array(
		'view' => array(
			'ID',
			'Name',
		),
		'edit' => array(
			'Name',
		),
	);

to the DataObject Code. But of course I want to limit access (at least for PUT requests) to authorized users. The Service shall be accessed via an external Script, so I'm thinking of using Basic Auth, with Username & Password transfered within the header of the request.

How do I get Silverstripe to read / accept this kind of authentication?

Thanks a lot for a bit of insight :)

Kind Regards
SF