Code:
/ FX-1434 / FX-1434 / 1.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
- CompositeDesignerAccessibleObject.cs
- GACIdentityPermission.cs
- TimerEventSubscriptionCollection.cs
- EdmTypeAttribute.cs
- CommandHelpers.cs
- TokenBasedSetEnumerator.cs
- _FixedSizeReader.cs
- TypeHelpers.cs
- HwndSourceKeyboardInputSite.cs
- SHA384.cs
- ProcessThread.cs
- Scheduling.cs
- UndirectedGraph.cs
- safelinkcollection.cs
- MultilineStringConverter.cs
- PopupRootAutomationPeer.cs
- RectAnimation.cs
- WebRequestModuleElementCollection.cs
- Vertex.cs
- FileChangesMonitor.cs
- PageContentAsyncResult.cs
- AppSettingsExpressionEditor.cs
- EntityViewGenerationAttribute.cs
- ConnectionStringsSection.cs
- IndexedGlyphRun.cs
- FacetDescription.cs
- FormatException.cs
- SchemaDeclBase.cs
- StreamInfo.cs
- GenerateHelper.cs
- ConsoleCancelEventArgs.cs
- NativeCppClassAttribute.cs
- RolePrincipal.cs
- ObjectListFieldsPage.cs
- SmiContext.cs
- RenamedEventArgs.cs
- TextStore.cs
- Array.cs
- ReadingWritingEntityEventArgs.cs
- FrameworkElementFactory.cs
- AstTree.cs
- StateMachineWorkflow.cs
- WindowsTooltip.cs
- HTMLTagNameToTypeMapper.cs
- MachineKeyConverter.cs
- DataFormats.cs
- SmtpFailedRecipientException.cs
- ControlParameter.cs
- XmlWrappingWriter.cs
- FontNamesConverter.cs
- RequestQueue.cs
- TransactionManager.cs
- DataServiceQueryProvider.cs
- BmpBitmapDecoder.cs
- ValueExpressions.cs
- DataSourceHelper.cs
- PrintControllerWithStatusDialog.cs
- ConnectionPoint.cs
- QueryAccessibilityHelpEvent.cs
- ImplicitInputBrush.cs
- Lease.cs
- SessionParameter.cs
- FamilyTypeface.cs
- ImageCodecInfo.cs
- OptimalBreakSession.cs
- ServiceModelSecurityTokenRequirement.cs
- FilteredReadOnlyMetadataCollection.cs
- DefaultProxySection.cs
- ISCIIEncoding.cs
- ColumnMapProcessor.cs
- NetPeerTcpBindingElement.cs
- HandleValueEditor.cs
- GridViewDesigner.cs
- InkSerializer.cs
- FixedLineResult.cs
- XmlExpressionDumper.cs
- XmlSignificantWhitespace.cs
- SqlAggregateChecker.cs
- DependencyPropertyValueSerializer.cs
- XmlSchemaSimpleType.cs
- Queue.cs
- LoadedEvent.cs
- DataGridClipboardCellContent.cs
- GridViewRowPresenter.cs
- HttpConfigurationContext.cs
- EdmComplexTypeAttribute.cs
- _ConnectStream.cs
- DragAssistanceManager.cs
- TemplateEditingService.cs
- RegistryPermission.cs
- Size3DConverter.cs
- IntSecurity.cs
- OleDbRowUpdatingEvent.cs
- XmlConvert.cs
- InternalTypeHelper.cs
- RepeaterItem.cs
- altserialization.cs
- SystemUdpStatistics.cs
- SchemaNotation.cs
- oledbmetadatacollectionnames.cs