Copied to clipboard

Flag this post as spam?

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


  • Alistair Thomson 6 posts 85 karma points
    Aug 10, 2022 @ 09:52
    Alistair Thomson
    0

    Routing and SSO

    I am working on an Umbraco 7 .NET 4.8 MVC web application.

    I am integrating ComponentSpace SSO. The application will be a service provider.

    I am confused about the routing taking place with Umbraco. I can see the app has a mixture of SurfaceController and RenderMvcController objects.

    I have added a regular Controller which is responsible for processing incoming saml assertions. The expected route (based on convention) is ~/saml/assertionconsumerservice. That is, the controller is named SamlController and the action method is named AssertionConsumerService.

    A test site without Umbraco works fine. When used with Umbraco this route produces a 404.

    I have looked at this https://our.umbraco.com/Documentation/Reference/Routing/Custom-Routes/index-v7 and https://our.umbraco.com/Documentation/Reference/Events/Application-Startup-v7

    however this may be the wrong way forward or otherwise it is unclear why I would want to implement IPublishedContent FindContent when all I need to do is tell Umbraco not to interfere with the route ~/saml/assertionconsumerservice.

    My question:

    How to I get umbraco to leave this route alone? ~/saml/assertionconsumerservice

    Appreciate any help here.

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Aug 10, 2022 @ 10:12
    Sebastiaan Janssen
    0

    You can tell Umbraco to leave it alone using Reserved URLs:

    https://our.umbraco.com/Documentation/Reference/Configuration-for-Umbraco-7-and-8/webconfig/index-v7#umbracoreservedurls

    Or I guess this should be a umbracoReservedPaths path instead.

  • Alistair Thomson 6 posts 85 karma points
    Aug 10, 2022 @ 10:16
    Alistair Thomson
    0

    Thanks Sebastiaan. I will check that out!

  • Alistair Thomson 6 posts 85 karma points
    Aug 10, 2022 @ 10:52
    Alistair Thomson
    0

    I am still seeing 404 responses sadly.

    I note that the project has a Global.asax file inherits Umbraco.Web.UmbracoApplication

    I non-Umbraco project would also have a Global.asax.cs with a call to RouteConfig.RegisterRoutes and this class would be inherited by Global.asax.

    How can I do this in the Umbraco project? When the url is requested ~/saml/assertionconsumerservice I need it to hit a controller named "SamlController" and the action named "AssertionConsumerService".

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Aug 10, 2022 @ 11:21
    Sebastiaan Janssen
    0

    It's been a while since I used 7, but I think this is probably how you want to register your routes: https://our.umbraco.com/Documentation/Reference/Routing/Custom-Routes/index-v7

  • Alistair Thomson 6 posts 85 karma points
    Aug 10, 2022 @ 12:17
    Alistair Thomson
    0

    Thanks Sebastiaan,

    I had started there (link in my initial post). The issue is that it's not clear how to implement FindContent() from the description on that page - unless I am missing this?

    The SAML controller method that I have processes an incoming SSO message then returns with RedirectToAction() when successful login occurs.

    So I don't quite understand the point of specifying the custom RouteHandler and the need to implement FindContent(), as presumably I just need to configure a route as follows : "When the requested url is 'saml/assertionconsumerservice' go to 'SamlController, AssertionConsumerService action'". Easy enough with a default MVC templated project, proving elusive with Umbraco.

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Aug 10, 2022 @ 12:29
    Sebastiaan Janssen
    100

    Yes I see, of course it has nothing to do with content so no need to FindContent!

    Think this comment from Andy should get you going: https://our.umbraco.com/forum/umbraco-7/using-umbraco-7/56478-Creating-a-custom-Controller-and-View-in-Umbraco-with-MVC-#comment-205964

  • Alistair Thomson 6 posts 85 karma points
    Aug 10, 2022 @ 12:39
    Alistair Thomson
    0

    Thanks Sebastiaan. That seems to be the way forward. I was so close :)

    Thanks for your help, I do seem to be able to route that SSO call now.

Please Sign in or register to post replies

Write your reply to:

Draft