ASP.NET 2.0: Implémenter son propre Membership provider en 30 minutes Danse Didier - Metrum Most Valuable Professional ASP.NET Developpez.com
Historique ASP Aucune aide ASP.NET 1.X ASP.NET 1.X Forms authentication ASP.NET 2.0 ASP.NET 2.0 Membership APIs
Les « APIs Membership » Permettent de: Créer des utilisateurs Sauvegarder des informations dans des environnements différents Authentifier des utilisateurs Gérer des mots de passe
Membership service MemberShip MemberShipUser MemberShip API SqlMemberShip Provider ActiveDirectory MemberShipProvider OwnMemberShip Provider Own DataActive Directory SqlServer database MemberShip Providers MemberShip Data
Membership service MemberShipMemberShipUser MemberShip API SqlMemberShip Provider ActiveDirectory MemberShipProvider OwnMemberShip Provider Own Data Active Directory SqlServer database MemberShip Providers MemberShip Data ASP.NET User management controls CreateUserLogin…
Méthodes MembershipProvider UpdateUser CreateUser DeleteUser ValidateUser UnlockUser
Méthodes MembershipProvider GetUserNameBy FindUsersBy /FindUsersByName ResetPassword ChangePassword …
Méthodes MembershipProvider CreateRole DeleteRole AddUserToRole Activation dans le Web.Config
ASP.NET Configuration website
Login Controls demo
Déclaration des propriétés pour un utilisateur <add name="LoginCount" type="System.Int32" defaultValue="0" />
Utilisation dans le code-behind string theme = Profile.Theme; dateTime anniversaire = Profile.Birthday; … Profile.Theme = " test “;
Profile demo
Membership service MemberShipMemberShipUser MemberShip API SqlMemberShip Provider ActiveDirectory MemberShipProvider OwnMemberShip Provider MemberShip Active Directory SqlServer database MemberShip Providers MemberShip Data
Membership Providers MembershipProvider (classe abstraite) OwnMembershipProvider ActiveDirectory MembershipProvider SqlMembershipProvider
Extrait du Web.config... <add name=“TextMembershipProvider" type=“TextMembershipProvider" enablePasswordRetrieval=“true" enablePasswordReset=“true“ … />...
Implémentation d’une classe dérivée de MemberShipProvider Déclaration dans web.config demo