Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / xsp / System / Web / Extensions / Security / AuthenticationService.cs / 1 / AuthenticationService.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Security { using System.Web.ApplicationServices; using System.Web.Script.Services; using System.Web.Services; [ScriptService] internal sealed class AuthenticationService { [WebMethod] public bool Login(string userName, string password, bool createPersistentCookie) { ApplicationServiceHelper.EnsureAuthenticationServiceEnabled(HttpContext.Current, true); // if(Membership.ValidateUser(userName, password)) { FormsAuthentication.SetAuthCookie(userName, createPersistentCookie); return true; } return false; } [WebMethod] public void Logout() { ApplicationServiceHelper.EnsureAuthenticationServiceEnabled(HttpContext.Current, false); FormsAuthentication.SignOut(); } [WebMethod] public bool IsLoggedIn() { ApplicationServiceHelper.EnsureAuthenticationServiceEnabled(HttpContext.Current, false); return HttpContext.Current.Request.IsAuthenticated; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Security { using System.Web.ApplicationServices; using System.Web.Script.Services; using System.Web.Services; [ScriptService] internal sealed class AuthenticationService { [WebMethod] public bool Login(string userName, string password, bool createPersistentCookie) { ApplicationServiceHelper.EnsureAuthenticationServiceEnabled(HttpContext.Current, true); // if(Membership.ValidateUser(userName, password)) { FormsAuthentication.SetAuthCookie(userName, createPersistentCookie); return true; } return false; } [WebMethod] public void Logout() { ApplicationServiceHelper.EnsureAuthenticationServiceEnabled(HttpContext.Current, false); FormsAuthentication.SignOut(); } [WebMethod] public bool IsLoggedIn() { ApplicationServiceHelper.EnsureAuthenticationServiceEnabled(HttpContext.Current, false); return HttpContext.Current.Request.IsAuthenticated; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HtmlToClrEventProxy.cs
- serverconfig.cs
- LabelInfo.cs
- StateItem.cs
- MatrixIndependentAnimationStorage.cs
- SqlConnectionManager.cs
- NameValueCollection.cs
- RichTextBox.cs
- GenericTypeParameterBuilder.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- XmlBinaryWriter.cs
- HtmlTitle.cs
- SqlNodeAnnotation.cs
- MatrixTransform.cs
- ServiceChannelProxy.cs
- FrameDimension.cs
- ServerIdentity.cs
- WorkflowServiceNamespace.cs
- SspiSafeHandles.cs
- _ServiceNameStore.cs
- ColumnHeaderConverter.cs
- TextDpi.cs
- SchemaImporter.cs
- NameValueFileSectionHandler.cs
- DNS.cs
- DataServiceRequest.cs
- HtmlInputControl.cs
- CodeRemoveEventStatement.cs
- SelfIssuedAuthProofToken.cs
- Int32Storage.cs
- ADMembershipProvider.cs
- _TimerThread.cs
- CustomAttributeFormatException.cs
- AccessedThroughPropertyAttribute.cs
- PeerContact.cs
- XamlUtilities.cs
- TextClipboardData.cs
- BackStopAuthenticationModule.cs
- MetadataArtifactLoader.cs
- Exception.cs
- SQLBoolean.cs
- Geometry3D.cs
- ClientScriptItem.cs
- AddIn.cs
- FamilyMapCollection.cs
- EdmRelationshipRoleAttribute.cs
- COAUTHINFO.cs
- XmlBinaryWriterSession.cs
- RightsManagementEncryptedStream.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- MatrixTransform3D.cs
- XmlSerializationReader.cs
- EventDescriptor.cs
- DropTarget.cs
- StylusPointProperties.cs
- TreeChangeInfo.cs
- CompressedStack.cs
- Utils.cs
- TransformerTypeCollection.cs
- OracleTransaction.cs
- TransformProviderWrapper.cs
- CompositeClientFormatter.cs
- ContactManager.cs
- PrimitiveXmlSerializers.cs
- ErrorTableItemStyle.cs
- WinEventWrap.cs
- ArrayConverter.cs
- Control.cs
- TransportConfigurationTypeElement.cs
- SoapReflectionImporter.cs
- UnsafeNativeMethods.cs
- _SslSessionsCache.cs
- UnSafeCharBuffer.cs
- CacheChildrenQuery.cs
- recordstatefactory.cs
- GeneralTransform3DGroup.cs
- DbProviderServices.cs
- TypeLibConverter.cs
- MenuItemBindingCollection.cs
- ResourceExpressionEditor.cs
- Function.cs
- XmlSchemaSimpleTypeUnion.cs
- ValidatingReaderNodeData.cs
- DataErrorValidationRule.cs
- BulletedList.cs
- StateManagedCollection.cs
- ExpressionPrefixAttribute.cs
- XmlLinkedNode.cs
- GenericsInstances.cs
- ConfigurationStrings.cs
- UndoManager.cs
- RuntimeVariableList.cs
- Vector3DKeyFrameCollection.cs
- FieldToken.cs
- ViewStateChangedEventArgs.cs
- SqlBulkCopy.cs
- ComEventsSink.cs
- SelectionRange.cs
- ComponentSerializationService.cs
- UnionCodeGroup.cs