Copied to clipboard

Flag this post as spam?

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


  • Neil Gilbert 1 post 71 karma points
    Apr 04, 2018 @ 13:48
    Neil Gilbert
    0

    Umbraco Rest Api - Authorization has been denied for this request

    I've installed the UmbracoCms.RestApi package, Changed my Web.Config to look at the UmbracoStandardOwinStartup class.

    I've also changed my UmbracoStandardOwinStartup class to this :

    app.ConfigureUmbracoRestApi(new UmbracoRestApiOptions()
            {
                //Modify the CorsPolicy as required
                CorsPolicy = new CorsPolicy()
                {
                    AllowAnyHeader = true,
                    AllowAnyMethod = true,
                    AllowAnyOrigin = true
                }
            });
    
            app.UseUmbracoBackOfficeTokenAuth();
    

    I am using postman to get the token via umbraco/oauth/token - Which gives me back a bearer token.... so far so good.

    I am next trying to do a GET on umbraco/rest/v1/content, I've added the Authorization header with my bearer token in the form of Bearer (then the token).

    However for every request i am getting the "Authorization has been denied for this request." but i'm not sure why!? Can anyone point me in the right direction?

  • Pavan 3 posts 73 karma points
    14 days ago
    Pavan
    0

    Hi Neil,

    Have you find any solution for this.I am also facing same issue.

    Thanks, Pavan

  • Pavan 3 posts 73 karma points
    1 week ago
    Pavan
    0

    I have to change in UmbracoAuthTokenServerExtensions.cs file.

    //TokenEndpointPath = new PathString("/umbraco/oauth/token"),

    to

    TokenEndpointPath = new PathString("/oauth/token"),

    then it will work.

    Thanks, Pavan

Please Sign in or register to post replies

Write your reply to:

Draft