Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable support for SimpleMemebership / OAuth / OpenID #39

Open
jjwilliams42 opened this issue Dec 22, 2012 · 5 comments
Open

Enable support for SimpleMemebership / OAuth / OpenID #39

jjwilliams42 opened this issue Dec 22, 2012 · 5 comments

Comments

@jjwilliams42
Copy link

In order to use this NuGet package, you must start from an Empty MVC 4 application - which does not have any of the OAuth / membership configured (as in the Internet Application). Would it be possible to allow this to work with the Internet Template for MVC4?

@erichexter
Copy link
Owner

I am not sure what it would take to make this work with the internet
template.. I started with the empty template because..it was quicker to get
started. I am open to looking into this.

Eric Hexter

blog | http://Hex.LosTechies.com
info | http://www.linkedin.com/in/erichexter

On Fri, Dec 21, 2012 at 10:42 PM, la2texas notifications@github.com wrote:

In order to use this NuGet package, you must start from an Empty MVC 4
application - which does not have any of the OAuth / membership configured
(as in the Internet Application). Would it be possible to allow this to
work with the Internet Template for MVC4?


Reply to this email directly or view it on GitHubhttps://github.com//issues/39.

@simonwoodhead
Copy link

I would also like to see this work with the internet template so I can just drop it into an existing project. Alternatively are there any instructions for adding simple membership and other features from the internet template to the empty template after adding twitter.bootstrap.mvc4?

Simon Woodhead

@jjwilliams42
Copy link
Author

Eric - from what I can tell there are just some dependencies missing, the AuthConfig.cs in App_Start, and the relevant .cshtml files and controllers. Is it as simple as configuring these in the NuGet package files? Will this violate any TOS or copyright laws (including the MS OAuth dependencies in this package)? This is my first time looking at an open source project, I've been following MVC since around its first iteration.

@jjwilliams42
Copy link
Author

Rundown of what I had to do to get it working (warning: lengthy process):

Create a new MVC 4 Internet Application

Install-Package twitter.bootstrap.mvc4

You will get an error: 'Views_ViewStart.cshtml' already exists. Skipping...

Copy this (twitter.bootstrap.mvc4) _ViewStart.cshtml from the GitHub project into the Views directory

Copy this (twitter.bootstrap.mvc4) ExampleLayoutsController.cs into the Controllers folder

Open ExampleLayoutRoutesConfig.cs in App_Start, and resolve the missing reference to HomeController

Open BootstrapBundleConfig.cs in App_Start - there is a naming conflict with the style bundle, change:

bundles.Add(new StyleBundle("~/content/css").Include(

to

bundles.Add(new StyleBundle("~/tbs/css").Include(
(notice I changed /content to /tbs)

Open _BootstrapLayout.basic.cshtml (as well as the other related files - *empty and *narrow.cshtml) and RenderSection the featured area:

In the _BootstrapLayout.basic.cshtml I added this after:

@Html.Partial("_alerts")
@Html.Partial("_validationSummary")
@RenderSection("featured", required: false)

Also at the top of each of these files make sure you are now pointing to the new virtual bundle path:

link href="@Styles.Url("~/tbs/css")" rel="stylesheet" - (notice the change from ~/content/css)

From this repo (or a twitter-bootstrapped empty mvc4 project you have already created), copy the entire Views\ExampleLayouts folder to the new internet project.

Modify your AuthConfig.cs to add some auth providers (facebook, google), then browse to /Account/Login to try one.

Now to streamline this process. I'm just learning about NuGet - not sure if the best way to go about it would be to branch off from twitter.bootstrap.mvc4 and create twitter.bootstrap.mvc4internet, or make it some kind of option with NuGet (if that can even be done?).

@Robzilla
Copy link

Hi Eric

Are there any updated Nuget packages for this problem and/or an example solution in GitHub?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants