Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / Configuration / AuthenticationConfig.cs / 1 / AuthenticationConfig.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* * AuthenticationConfigHandler class * * Copyright (c) 1999 Microsoft Corporation */ namespace System.Web.Configuration { using System.Runtime.Serialization; using System.Web.Util; using System.Collections; using System.IO; using System.Security.Principal; using System.Xml; using System.Security.Cryptography; using System.Configuration; using System.Globalization; using System.Web.Hosting; static internal class AuthenticationConfig { internal static String GetCompleteLoginUrl(HttpContext context, String loginUrl) { if (String.IsNullOrEmpty(loginUrl)) { return String.Empty; } if (UrlPath.IsRelativeUrl(loginUrl)) { loginUrl = UrlPath.Combine(HttpRuntime.AppDomainAppVirtualPathString, loginUrl); } return loginUrl; } internal static bool AccessingLoginPage(HttpContext context, String loginUrl) { if (String.IsNullOrEmpty(loginUrl)) { return false; } loginUrl = GetCompleteLoginUrl(context, loginUrl); if (String.IsNullOrEmpty(loginUrl)) { return false; } // Ignore query string int iqs = loginUrl.IndexOf('?'); if (iqs >= 0) { loginUrl = loginUrl.Substring(0, iqs); } String requestPath = context.Request.Path; if (StringUtil.EqualsIgnoreCase(requestPath, loginUrl)) { return true; } // It could be that loginUrl in config was UrlEncoded (ASURT 98932) if (loginUrl.IndexOf('%') >= 0) { String decodedLoginUrl; // encoding is unknown try UTF-8 first, then request encoding decodedLoginUrl = HttpUtility.UrlDecode(loginUrl); if (StringUtil.EqualsIgnoreCase(requestPath, decodedLoginUrl)) { return true; } decodedLoginUrl = HttpUtility.UrlDecode(loginUrl, context.Request.ContentEncoding); if (StringUtil.EqualsIgnoreCase(requestPath, decodedLoginUrl)) { return true; } } return false; } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Axis.cs
- WebPartCollection.cs
- ArglessEventHandlerProxy.cs
- XmlReflectionMember.cs
- OpenTypeMethods.cs
- HintTextMaxWidthConverter.cs
- EmptyEnumerator.cs
- SecurityCapabilities.cs
- DataGridToolTip.cs
- TrackBarDesigner.cs
- AnnotationDocumentPaginator.cs
- BitmapDownload.cs
- _NtlmClient.cs
- AsyncPostBackTrigger.cs
- SocketStream.cs
- AutomationEvent.cs
- BuildTopDownAttribute.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- NumberFormatInfo.cs
- DataException.cs
- InfoCardArgumentException.cs
- FontStretches.cs
- OneOf.cs
- ContentWrapperAttribute.cs
- ContentTextAutomationPeer.cs
- NamedPermissionSet.cs
- AnnotationResourceCollection.cs
- MatrixTransform3D.cs
- WebPartEventArgs.cs
- EditorPartChrome.cs
- _Rfc2616CacheValidators.cs
- ExceptionUtil.cs
- TableRowCollection.cs
- EncodedStreamFactory.cs
- RectConverter.cs
- QuadTree.cs
- BulletedListDesigner.cs
- GetMemberBinder.cs
- XmlMapping.cs
- ErrorHandler.cs
- Transactions.cs
- Scene3D.cs
- altserialization.cs
- ReceiveDesigner.xaml.cs
- VarInfo.cs
- ConfigurationValue.cs
- TableHeaderCell.cs
- DiscoveryClientRequestChannel.cs
- SchemaImporterExtensionsSection.cs
- LowerCaseStringConverter.cs
- XPathQilFactory.cs
- InfoCard.cs
- DataSourceIDConverter.cs
- ObjectParameterCollection.cs
- ToolStripPanelCell.cs
- WindowsScroll.cs
- DataGridViewRowCollection.cs
- SchemaElementLookUpTableEnumerator.cs
- LinqDataSourceUpdateEventArgs.cs
- ByteStorage.cs
- QilLoop.cs
- COM2PropertyDescriptor.cs
- SHA1Cng.cs
- ChangeProcessor.cs
- CodePageUtils.cs
- RoleService.cs
- DoubleAnimationClockResource.cs
- Base64Encoder.cs
- SerializationInfo.cs
- WSSecurityTokenSerializer.cs
- SqlNodeTypeOperators.cs
- Pkcs9Attribute.cs
- CodeDirectionExpression.cs
- KeyTimeConverter.cs
- PlanCompiler.cs
- NativeMethods.cs
- InputLangChangeRequestEvent.cs
- EntityDataSourceMemberPath.cs
- NativeMethods.cs
- X509Chain.cs
- StringReader.cs
- SchemaMapping.cs
- SessionPageStateSection.cs
- GroupBoxRenderer.cs
- DocumentSequence.cs
- DataGridPagingPage.cs
- XamlToRtfParser.cs
- PaperSource.cs
- ListItemConverter.cs
- DataGridComboBoxColumn.cs
- StorageMappingFragment.cs
- GeometryModel3D.cs
- LayoutSettings.cs
- GlyphInfoList.cs
- NavigationHelper.cs
- SspiNegotiationTokenAuthenticatorState.cs
- StorageSetMapping.cs
- BaseTemplateBuildProvider.cs
- DesignerPerfEventProvider.cs
- VectorValueSerializer.cs