Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8703573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:53:51+00:00 2026-06-13T02:53:51+00:00

I can’t get SS authentication to work together with an Umbraco installation. Whenever I

  • 0

I can’t get SS authentication to work together with an Umbraco installation. Whenever I access a DTO or service with the Authenticate attribute, I get redirected to an umbraco login.
To reproduce:
I’ve created a new project, and installed Umbraco from Nuget (tried 4.7.1, 4.8.1 and 4.9.0 with same result), and SS from Nuget. I setup SS to run under the /api path in the web.config:

  <location path="api">
    <system.web>
      <httpHandlers>
        <add path="*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" />
      </httpHandlers>
    </system.web>
    <!-- Required for IIS 7.0 -->
    <system.webServer>
      <modules runAllManagedModulesForAllRequests="true" />
      <validation validateIntegratedModeConfiguration="false" />
      <handlers>
        <add path="*" name="ServiceStack.Factory" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true" />
      </handlers>
    </system.webServer>
  </location>

and added /api to reserved paths to avoid Umbraco handling this:

<add key="umbracoReservedPaths" value="~/umbraco,~/install/,~/api" />

And in the AppHost.cs I’ve changed the EndpointHostConfig and enabled authentication:

   SetConfig(new EndpointHostConfig
   {
       DebugMode = true, //Show StackTraces when developing
       ServiceStackHandlerFactoryPath = "api"
   });

//Enable Authentication
ConfigureAuth(container);

And I’ve changed the connectionstring in ConfigureAuth to use the Umbraco database:

    var connectionString = ConfigurationManager.AppSettings["umbracoDbDSN"];

Finally I set the attribute on HelloWorldService:

[Authenticate]
public class HelloService : ServiceBase<Hello>
{
    protected override object Run(Hello request)
    {
        return new HelloResponse { Result = "Hello, " + request.Name };
    }
}

I then access the HelloWorldService through REST Uri:

http://localhost:56835/api/hello

and right away I’m redirected to:

http://localhost:56835/apilogin?redirect=http%3a%2f%2flocalhost%3a56835%2fapi%2fhello

and presented with the default Umbraco 404 page, which means that SS suddenly makes Umbraco handle the authentication. If I remove the Authenticate attribute, SS handles the request perfectly.

What am I missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T02:53:53+00:00Added an answer on June 13, 2026 at 2:53 am

    It seems that FormsAuthentication is just plain annoying, and when it spots a 401 it changes that to 302 login.aspx.
    My solution was use use the idea from this link: http://haacked.com/archive/2011/10/04/prevent-forms-authentication-login-page-redirect-when-you-donrsquot-want.aspx

    In short it revert the 401->302 change from FormsAuthentication back to 401.
    I changed it a bit in the detection code:

     if (response.StatusCode == 401 && request.RawUrl.ToLower().StartsWith("/api"))
    

    and removed the Register and added it manually AFTER the FormsAuthentication module in web.config

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can I change the field public virtual ClassOne ClassOne { get; set; } to
Can I authenticate with just Google account username and password instead of using OAuth?
Can any one tell, how to get the result of LINQ query contains group
Can someone please explain why this doesn't work? MyClass myClass1 = new MyClass(); object
Can someone access the database files and/or other files of my app stores in
Can i get the source code for a WAMP stack installer somewhere? Any help
Can find why i get this error can someone help? package Android.data; public class
Can anyone help me trying to find out why this doesn't work. The brushes
can not reproduce deadlock using the next code I am trying yo get a
Can anyone let me know how can we change the value of kendo combobox

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.