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

  • SEARCH
  • Home
  • 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 3789952
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T12:14:19+00:00 2026-05-19T12:14:19+00:00

I have a structure like this WebUI project – controllers, views Framework project- repositories,service

  • 0

I have a structure like this

WebUI project – controllers, views
Framework project- repositories,service layer and domain

So now I have 3 methods/classes

  1. Open Id/Open auth

At first I thought I would put all my logic in a service layer in my framework project(preparing the request, checking the response and etc would be in this layer).

So now I am using the dotnetopenauth library and because I need to use the AsActionResult method in my controller(I return “OutgoingWebResponse” from my service layer as I don’t want anything MVC in my service layers)

It got me to thinking when I decided not to have anything MVC in my service layer. As what I read is that your service layer that contains your business logic should not have any dependencies like MVC references because if you go to a windows phone application you should not be using MVC stuff.

Your business layer should be sort of plug and play into any application.

So now I am not sure if I should move what I wrote for openId into my models folder in my mvc projectjust for the reasons above. Since if I do go to a windows phone application or forms application I won’t be using dotnetopenauth since I don’t think it’s supported in these types of applications.

  1. My second one is with forms authentication. Again pretty much same reasons as above. Should this go as well in my models folder as a local service/repo layer(ie in the same project file).

  2. I am using nhibernate, fluent nhiberate and ninject. My repos are all in my framework project. So I have of course all the references in there. But since I am using ninject for ioc I have all the references in my webui project as well.

I have no clue if this one could be changed to get rid of these references from my webui. I am thinking no because they I can’t have my ioc in my webui where I think it should go.

  • 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-05-19T12:14:20+00:00Added an answer on May 19, 2026 at 12:14 pm

    As a general rule of thumb you shouldn’t write code against requirements that don’t exist ( porting the app to a windows phone ) .

    Normally you’d abstract this out in your service layer however OAuth or Facebook integration poses a problem because of its reliance on http and being able to visit the authenticating site.

    The problem you’ll run into because “all abstractions are leaky” is that your service layer will be corrupted somehow by the openauth registration process regardless of where you place it. Details about user registration and login such as what their openid url is will end up in your database. You’re service/repo/db/model/mvc/viewmodel/controllers classes are all going to know what openauth is because of its nature.

    The good thing is these browser based authentication strategies can live in a Windows Form, WPF or Silverlight application. You simply open a browser inside the application instead of redirecting natively with MVC.

    So what I’d recommend is placing your dotnetopen auth registration code inside of your service layer and actually abstracting out how the redirection and callback process happens.

    Something like:

    public interface IOpenAuthRedirect
    {
          public void Redirect( url )
          public void ParseCallback( url )
    }
    
    
    public class MVCOpenAuthRedirect
    {
         public void Redirect(url)
         {
            HttpContext.Current.Response.Redirect(url);
         }
    }
    
    public class SilverlightOpenAuthRedirect
    {
        public void RedirectUrl( url )
        {
            SomeBrowserControl.IForgetTheCallToRedirect( url );
        }   
    
    }
    

    Now the different implementation details are flexible and you can easily transition to another platform besides MVC.

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

Sidebar

Related Questions

I have a structure like this: /home /home/dir1 /home/dir2 Now when someone goes to
I have a structure like this: <ul> <li>text1</li> <li>text2</li> <li>text3</li> </ul> How do I
Currently I have a structure like this: A | +--B | +--C It's mapped
I have a SVN structure like this: /Projects /Project1 /Project2 /someFolder /Project3 /Project4 I
I have a XML Structure that looks like this. <sales> <item name=Games sku=MIC28306200 iCat=28
If I have a folder structure set up like this: ~/Projects emacs package1 package1-helpers
I have a data structure that represents C# code like this: class Namespace: string
i have structure like this <table><tr><td></td><td><input type=button name=button></td></tr></table> <script> $('tr').click(function(){window.alert('tr');}) $(':input').click(function(){window.alert('input');}) </script> when i
I have a structure like this in a DB | RoleID | RoleTypeID |
I have table structure like this: ID cond 1 5 1 2 1 6

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.