Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Is there an example on how to call api only for authenticate member and not backoffice user?
Hi Biagio
UmbracoApiController ?
You can decorate the controller or action with a MemberAuthorize decoration eg:
[MemberAuthorize(AllowType = "MemberTypeName")] public class MyLovelyApiController : UmbracoApiController
would secure by MemberType Alias
or
[MemberAuthorize(AllowGroup = "MemberGrouporRole")] public class MyLovelyApiController : UmbracoApiController
by Member Group/Role
[MemberAuthorize(AllowMembers = "member1,member2,member3")] public class MyLovelyApiController : UmbracoApiController
would be a comma separated list of specific users...
if that helps ?
regards
Marc
Perfect answer, do you even know if it does only work with cookies ? I would need some kind of auth for mobile apps ... without cookies.
I couldn't find anything further regarding the MemberAuthorize attribute.
Hi Norbert
Have a look at this article Warren Buckley wrote about using JWT tokens to secure Umbraco API controllers:
http://creativewebspecialist.co.uk/2015/01/06/securing-umbraco-web-apis-using-json-web-tokens/
This a better https://github.com/warrenbuckley/Umbraco-JWT-AuthTokens starting point to create Umbraco WebAPI because it authenticate and authorize members and users. The Umbraco Rest Api pack is in stand by and AA only the users.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
REST APIs in Umbraco: Example how to secure api call only from member login?
Is there an example on how to call api only for authenticate member and not backoffice user?
Hi Biagio
UmbracoApiController ?
You can decorate the controller or action with a MemberAuthorize decoration eg:
would secure by MemberType Alias
or
by Member Group/Role
or
would be a comma separated list of specific users...
if that helps ?
regards
Marc
Perfect answer, do you even know if it does only work with cookies ? I would need some kind of auth for mobile apps ... without cookies.
I couldn't find anything further regarding the MemberAuthorize attribute.
Hi Norbert
Have a look at this article Warren Buckley wrote about using JWT tokens to secure Umbraco API controllers:
http://creativewebspecialist.co.uk/2015/01/06/securing-umbraco-web-apis-using-json-web-tokens/
This a better https://github.com/warrenbuckley/Umbraco-JWT-AuthTokens starting point to create Umbraco WebAPI because it authenticate and authorize members and users. The Umbraco Rest Api pack is in stand by and AA only the users.
is working on a reply...