Code Monkey home page Code Monkey logo

Comments (14)

brockallen avatar brockallen commented on August 20, 2024

What do you not understand? Feel free to ask here.

What are the build errors? Feel free to report them here.

The "Single Tenant" is sort of the "Hello World" -- once you get it all compiled, run it and walk thru what it does. Hopefully it will make more sense. If not, post questions here.

from brockallen.membershipreboot.

hades200082 avatar hades200082 commented on August 20, 2024
  1. Build error on sample app was VS2012 not correctly identifying that it needed to download EF. Even though it was set to install missing packages automatically. Had this a few times with other projects and haven't tracked down the cause yet... reinstalling EF manually seems to work though.

I've tried configuring it in my own project though and keep hitting the following two problems.

1

In NinjectWebCommon.cs ...

var baseUrl = HttpContext.Current.GetApplicationUrl();

... the above code tells me that GetApplicationUrl() doesn't exist. (I have using BrockAllen.MembershipReboot; at the top.)

2

In Global.asax.cs under InitDatabase() (as copied directly from your sample app)...

svc.Update(account);

... tells me that ...

'BrockAllen.MembershipReboot.UserAccountService' does not contain a definition for 'Update' and no extension method 'Update' accepting a first argument of type 'BrockAllen.MembershipReboot.UserAccountService' could be found

I can't se a difference between what I have in my project and the sample project at present... any ideas or a swift kick in the right direction would be appreciated :)

from brockallen.membershipreboot.

brockallen avatar brockallen commented on August 20, 2024

For #1 -- try building the component first in the src folder. This seems to be a chronoc problem with NuGet and various solutions referencing the same project from different locations.

Fro #2 -- I think your copy of the source is out of date. Check the latest from github.

from brockallen.membershipreboot.

hades200082 avatar hades200082 commented on August 20, 2024

I used the NuGet install for it so that may be the problem. I'll test it with latest version.

Any idea when NuGet will be updated? I prefer to use it for package management to keep things tidy and my repo size down.

from brockallen.membershipreboot.

hades200082 avatar hades200082 commented on August 20, 2024

Update : Compiling the latest from GitHub fixed both errors. Any idea when NuGet will be updated?

from brockallen.membershipreboot.

brockallen avatar brockallen commented on August 20, 2024

Well, it's not a nuget issue, per-se. It's more of an issue that two solutions reference the same project, so the project-relative paths to the packages gets confused.

I'll leave this open as a reminder for me to see if there's' anything I can do with the code organization to help with this.

Glad it's working better for you now.

from brockallen.membershipreboot.

hades200082 avatar hades200082 commented on August 20, 2024

One other item to note... on your github readme it mentions the emailIsUsername config option and the other web.config entries but it doesn't mention needing the following in the configSections node

<section name="membershipReboot" type="BrockAllen.MembershipReboot.SecuritySettings, BrockAllen.MembershipReboot" />

Caused me an issue too until I compared my web.config with yours and spotted the difference. You may want to add it to the readme :)

from brockallen.membershipreboot.

brockallen avatar brockallen commented on August 20, 2024

yea, i should reopen this:
#7

from brockallen.membershipreboot.

hades200082 avatar hades200082 commented on August 20, 2024

Hmm... got another one for you.

After logging in on the sample the top menu fails to change.

In the view you have @if (User.Identity.IsAuthenticated) but this seems to always evaluate to false.

from brockallen.membershipreboot.

brockallen avatar brockallen commented on August 20, 2024

Not sure -- I'd suggest debugging it so that as you walk thru the code you become more familiar with how it works.

from brockallen.membershipreboot.

hades200082 avatar hades200082 commented on August 20, 2024

Debugging no help.... it was another web.config omission...

<system.identityModel.services>
    <federationConfiguration>
        <cookieHandler requireSsl="false" />
    </federationConfiguration>
</system.identityModel.services>

Another one for you to add to readme 👍

from brockallen.membershipreboot.

hades200082 avatar hades200082 commented on August 20, 2024

Here's a complete list of all the web.config sections I needed to get it working.... I've snipped out all the standard stuff that was already in there so you can see only the relevant entries.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <!-- // ...... // -->
    <section name="system.identityModel" type="System.IdentityModel.Configuration.SystemIdentityModelSection, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
    <section name="system.identityModel.services" type="System.IdentityModel.Services.Configuration.SystemIdentityModelServicesSection, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
    <section name="membershipReboot" type="BrockAllen.MembershipReboot.SecuritySettings, BrockAllen.MembershipReboot" />
    <!-- // ...... // -->
  </configSections>
  <membershipReboot 
    connectionStringName="DefaultConnection" 
    requireAccountVerification="true" 
    emailIsUsername="true" 
    multiTenant="false" 
    passwordHashingIterationCount="10" 
    accountLockoutDuration="00:01:00" 
    passwordResetFrequency="0" />
  <connectionStrings>
    <add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-Template-20130608002007;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-Template-20130608002007.mdf" />
  </connectionStrings>

  <!-- // ...... // -->

  <system.web>

    <!-- // ...... // -->

    <authentication mode="Forms">
      <forms loginUrl="~/UserAccount/Login"></forms>
    </authentication>

    <!-- // ...... // -->

  </system.web>
  <system.webServer>

    <!-- // ...... // -->

    <modules>
      <add name="SessionAuthenticationModule" type="System.IdentityModel.Services.SessionAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" />
    </modules>

    <!-- // ...... // -->

  </system.webServer>

  <system.net>
    <mailSettings>
      <smtp deliveryMethod="Network" from="[email protected]">
        <network host="smtp.mymailserver.com" port="587" userName="[email protected]" password="mypassword" enableSsl="true" />
      </smtp>
    </mailSettings>
  </system.net>
  <system.identityModel.services>
    <federationConfiguration>
      <cookieHandler requireSsl="false" />
    </federationConfiguration>
  </system.identityModel.services>

    <!-- // ...... // -->

</configuration>

from brockallen.membershipreboot.

hades200082 avatar hades200082 commented on August 20, 2024

If I set it to emailIsUsername="true", what happens if I let the user change their username to something other than their email address? Would it still use their email address to log in with?

For example... I want it to use either email or username as their login... users choice at time of logging in.

I hope this makes sense?

from brockallen.membershipreboot.

brockallen avatar brockallen commented on August 20, 2024

Well, if you configure that setting that then don't expose any web pages or APIs that allow users to change their username :)

Internally we throw if you try to change the username and that setting is configured. use the ChangeEmail API instead.

from brockallen.membershipreboot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.