Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • jivan thapa 194 posts 681 karma points
    Dec 12, 2014 @ 10:12
    jivan thapa
    0

    UmbracoAuthorize always returns Authorization has been denied on a production server

    Some weird problem when using UmbracoApiController. [U-7.1.6 assembly: 1.0.5350.25714]

    I have a controller that uses UmbracoApiController. When I request a url 'umbraco/api/CReview/Delete/4', it says 'Authorization has been denied' on the production server, even i have logged in as admin.

    Locally it works fine, no problem. It's only problem on the production server.

    public class CReviewController : UmbracoApiController
        {
    
            [System.Web.Http.AcceptVerbs("GET", "POST")]
            [System.Web.Http.HttpGet]
            [Umbraco.Web.WebApi.UmbracoAuthorize]
            public string Delete(string id)
            {
                // delete operation goes here
                return "true";
            }
    
        }
    
  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Dec 12, 2014 @ 10:29
    Dave Woestenborghs
    100

    There is another API that you can use withouth the UmbracoAuthorize attribute.

    Just remove the attribute and inherits your controller from UmbracoAuthorizedApiController

    The only thing you need to take in account is that the url for your API changes when you this.

    Your url will become /umbraco/backoffice/CReview/Delete/4

    Dave

  • jivan thapa 194 posts 681 karma points
    Dec 12, 2014 @ 10:55
    jivan thapa
    0

    @Dave thanks for your response. I will try with UmbracoAuthorizedApiController

    Just one more stuff, If I disable ssl certificate, It does work as expected.

    But It does not work on https.

    Does https makes difference on umbraco authentication?

  • jivan thapa 194 posts 681 karma points
    Dec 12, 2014 @ 12:07
    jivan thapa
    0

    @Dave Thanks,

    This did not work '/umbraco/backoffice/CReview/Delete/4'

    But This worked /umbraco/backoffice/api/CReview/Delete/4

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Dec 12, 2014 @ 12:19
    Dave Woestenborghs
    0

    Hi Jivan,

     

    Just typed it from memory..Probably why I forgot to include api.

    Dave

Please Sign in or register to post replies

Write your reply to:

Draft