Comments (14)
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.
- 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.
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.
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.
Update : Compiling the latest from GitHub fixed both errors. Any idea when NuGet will be updated?
from brockallen.membershipreboot.
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.
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.
yea, i should reopen this:
#7
from brockallen.membershipreboot.
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.
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.
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.
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.
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.
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)
- Should I set authentication mode to forms or None? HOT 4
- Way to get properties for custom UserAccount in query methods HOT 1
- Account Creation Email HOT 2
- SignIn works fine - SignOut tosses: Cannot HOT 1
- MR with IdentityServer3 HOT 1
- NuGet package: MembershipReboot 9.0.0 does not fit MembershipReboot.Webhost 7.1.0 HOT 1
- MembershipReboot and LoadBalancing... HOT 1
- Serializable attribute
- Cancel Password Reset deletes User Account
- Guidance in moving to asp.net identity? HOT 12
- ChangeEmail HOT 1
- Membership Reboot and Identity HOT 2
- How to set up a CustomUserRepository? HOT 8
- Question: 9.0 release notes?
- ChangeEmailRequest should change username in case of EmailIsUsername and not RequireAccountVerification HOT 2
- PasswordReset : Email is not being sent
- userAccountService.GetByMobile(string mobile) always returns null
- Porting to dotnet core... any interest? HOT 3
- How to edit claims for multiple accounts in one transaction?
- Best Practice for MembershipReboot with IDSvr3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brockallen.membershipreboot.