Re: [dotnetopenauth] Can I use MVC just for login for an asp.net site?

65 views
Skip to first unread message

Brad Laney

unread,
Aug 7, 2012, 9:56:47 PM8/7/12
to dotnet...@googlegroups.com

I don't exactly know what you are saying. You are either using web forms, MVC, or a non Microsoft view engine. It sounds like you are using web forms, but no controls?

Anyway. If you implement .net membership for security, you can share the auth token between the two sites. Its very simple. You can use the default membership provider to accomplish this.

If you pm me I can give you some sort of an example

On Aug 7, 2012 8:17 PM, "Bill Gillingham" <ebs...@gmail.com> wrote:
Sorry for such a general question...

I am migrating my site from classic ASP to asp.net.  Phase one of my migration was to get things running on asp.net - and they are!  Phase 2 is to convert the site to MVC (I am already using RouteTable and PageRouteHandler - so, I can see my path fairly well).  That being said, I want to implement OpenID in phase one.  All examples of DotNetOpenID seem to involve Web Forms (I don't use them - no server side controls) and MVC.

I think I read that MVC can be implemented over time - if so, would it be wise to implement MVC just for 'mysite.com/Login'  ?  I'm using VB.Net - if that raises any red-flags.

I don't use any server-side controls - the app is just generating html and spitting it out to my master template.  I don't plan on using Web Forms - but do plan to update the entire site to use MVC.

(So, basically, I am a newb to asp.net trying to implement OpenID using vb.net by following code written in c# that uses technologies I am not using (web forms and MVC).)

Hope I'm making a bit of sense :(

Thanks,
bill

--
You received this message because you are subscribed to the Google Groups "DotNetOpenAuth" group.
To view this discussion on the web visit https://groups.google.com/d/msg/dotnetopenid/-/gZUinBQ4HxMJ.
To post to this group, send email to dotnet...@googlegroups.com.
To unsubscribe from this group, send email to dotnetopenid...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/dotnetopenid?hl=en.

Andrew Arnott

unread,
Aug 8, 2012, 12:20:35 AM8/8/12
to dotnet...@googlegroups.com
Brad, I learned recently that web forms and MVC can coexist in the same web project quite well.  

Bill, there are indeed samples of accepting OpenID on MVC web sites.  Just download http://sourceforge.net/projects/dnoa/files/latest/ and check out the OpenIdRelyingPartyMvc sample.

--
Andrew Arnott
"I [may] not agree with what you have to say, but I'll defend to the death your right to say it." - S. G. Tallentyre

Bill Gillingham

unread,
Aug 8, 2012, 12:36:34 AM8/8/12
to dotnet...@googlegroups.com
Thanks for the reply - I guess I am using webforms...  I am using a few aspx files and routes (which resolve to aspx files) and a mater page.  I guess when I think of 'webforms,' I think of things like:

<asp:Button ID="loginButton" runat="server" Text="Login" OnClick="loginButton_Click" />

But, I think you are suggesting (and I'll look into it - no need to clarify) that web-forms are pretty much 'aspx' - whereas MVC is handled differently (without aspx files - ultimately by controllers).

Just knowing this will help - it always helps to know what name is used to describe the thing you are doing!  (Makes searching google much easier too).

bill

Ryan Rousseau

unread,
Aug 8, 2012, 12:49:40 AM8/8/12
to dotnet...@googlegroups.com
It sounds like you are using the WebForms view engine for MVC (and depending on your version of MVC, it is the default option). Your views will end in aspx, but there won't be a code behind (aspx.cs file) because the logic is backed by controllers. 

If you have the option to change, Razor is a much better view engine (and there are many more 3rd party engines available) b
To view this discussion on the web visit https://groups.google.com/d/msg/dotnetopenid/-/tLvpmfop6MgJ.

Andrew Arnott

unread,
Aug 8, 2012, 2:33:57 PM8/8/12
to dotnet...@googlegroups.com
In MVC, you have controllers, but you also have views.  .aspx is your view.  A "pure" MVC solution arguably means not only that the view has no code-behind, but that your view does not contain any ASP.NET controls, like buttons as you've pointed out.

Just in case the answer isn't clear then, the answer is yes, we have samples that do OpenID logins in the pure MVC style (not relying on ASP.NET controls) and samples that use ASP.NET controls in web forms.  While none of the samples use Razor (one of the view engines that you can use with MVC) because it's all pure HTML anyway it shouldn't really matter.

--
Andrew Arnott
"I [may] not agree with what you have to say, but I'll defend to the death your right to say it." - S. G. Tallentyre


To view this discussion on the web visit https://groups.google.com/d/msg/dotnetopenid/-/tLvpmfop6MgJ.
Reply all
Reply to author
Forward
0 new messages