Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / Configuration / PassportAuthentication.cs / 2 / PassportAuthentication.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /***************************************************************************** From machine.config******************************************************************************/ namespace System.Web.Configuration { using System; using System.Xml; using System.Configuration; using System.Collections.Specialized; using System.Collections; using System.Globalization; using System.IO; using System.Text; using System.Web.Util; using System.ComponentModel; using System.Security.Permissions; [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class PassportAuthentication : ConfigurationElement { private static readonly ConfigurationElementProperty s_elemProperty = new ConfigurationElementProperty(new CallbackValidator(typeof(PassportAuthentication), Validate)); private static ConfigurationPropertyCollection _properties; private static readonly ConfigurationProperty _propRedirectUrl = new ConfigurationProperty("redirectUrl", typeof(string), "internal", ConfigurationPropertyOptions.None); static PassportAuthentication() { // Property initialization _properties = new ConfigurationPropertyCollection(); _properties.Add(_propRedirectUrl); } public PassportAuthentication() { } protected override ConfigurationPropertyCollection Properties { get { return _properties; } } [ConfigurationProperty("redirectUrl", DefaultValue = "internal")] [StringValidator()] public string RedirectUrl { get { return (string)base[_propRedirectUrl]; } set { base[_propRedirectUrl] = value; } } protected override ConfigurationElementProperty ElementProperty { get { return s_elemProperty; } } private static void Validate(object value) { if (value == null) { throw new ArgumentNullException("passport"); } Debug.Assert(value is PassportAuthentication); PassportAuthentication elem = (PassportAuthentication)value; if (StringUtil.StringStartsWith(elem.RedirectUrl, "\\\\") || (elem.RedirectUrl.Length > 1 && elem.RedirectUrl[1] == ':')) { throw new ConfigurationErrorsException(SR.GetString(SR.Auth_bad_url)); } } } // class PassportAuthentication } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /***************************************************************************** From machine.config******************************************************************************/ namespace System.Web.Configuration { using System; using System.Xml; using System.Configuration; using System.Collections.Specialized; using System.Collections; using System.Globalization; using System.IO; using System.Text; using System.Web.Util; using System.ComponentModel; using System.Security.Permissions; [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class PassportAuthentication : ConfigurationElement { private static readonly ConfigurationElementProperty s_elemProperty = new ConfigurationElementProperty(new CallbackValidator(typeof(PassportAuthentication), Validate)); private static ConfigurationPropertyCollection _properties; private static readonly ConfigurationProperty _propRedirectUrl = new ConfigurationProperty("redirectUrl", typeof(string), "internal", ConfigurationPropertyOptions.None); static PassportAuthentication() { // Property initialization _properties = new ConfigurationPropertyCollection(); _properties.Add(_propRedirectUrl); } public PassportAuthentication() { } protected override ConfigurationPropertyCollection Properties { get { return _properties; } } [ConfigurationProperty("redirectUrl", DefaultValue = "internal")] [StringValidator()] public string RedirectUrl { get { return (string)base[_propRedirectUrl]; } set { base[_propRedirectUrl] = value; } } protected override ConfigurationElementProperty ElementProperty { get { return s_elemProperty; } } private static void Validate(object value) { if (value == null) { throw new ArgumentNullException("passport"); } Debug.Assert(value is PassportAuthentication); PassportAuthentication elem = (PassportAuthentication)value; if (StringUtil.StringStartsWith(elem.RedirectUrl, "\\\\") || (elem.RedirectUrl.Length > 1 && elem.RedirectUrl[1] == ':')) { throw new ConfigurationErrorsException(SR.GetString(SR.Auth_bad_url)); } } } // class PassportAuthentication } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- EventManager.cs
- CompleteWizardStep.cs
- BasicExpressionVisitor.cs
- SrgsRulesCollection.cs
- panel.cs
- ItemAutomationPeer.cs
- NeedSkipTokenVisitor.cs
- XmlNamespaceManager.cs
- WebPartChrome.cs
- VisualBasicSettingsHandler.cs
- AutomationElementCollection.cs
- QuaternionIndependentAnimationStorage.cs
- InternalMappingException.cs
- TextDecorations.cs
- ExtenderProvidedPropertyAttribute.cs
- _DisconnectOverlappedAsyncResult.cs
- ArgumentNullException.cs
- CoTaskMemHandle.cs
- DiscoveryInnerClientAdhoc11.cs
- TdsParserSafeHandles.cs
- HtmlInputButton.cs
- ValidationError.cs
- BinaryWriter.cs
- DataConnectionHelper.cs
- SettingsContext.cs
- ScriptIgnoreAttribute.cs
- ZipIOBlockManager.cs
- Mapping.cs
- SelectingProviderEventArgs.cs
- XmlHelper.cs
- VisualProxy.cs
- EntityReference.cs
- BaseWebProxyFinder.cs
- XmlUtf8RawTextWriter.cs
- KeyedHashAlgorithm.cs
- ResourceProviderFactory.cs
- ReturnValue.cs
- DecoderReplacementFallback.cs
- AnnotationService.cs
- DataObject.cs
- CSharpCodeProvider.cs
- ToolStripStatusLabel.cs
- ResolveNameEventArgs.cs
- CodeIndexerExpression.cs
- OracleCommandBuilder.cs
- Add.cs
- basecomparevalidator.cs
- RequestSecurityToken.cs
- KeyValuePair.cs
- WebBrowserNavigatingEventHandler.cs
- ConditionCollection.cs
- RowToFieldTransformer.cs
- DesignerToolStripControlHost.cs
- TimeZone.cs
- ContextMenu.cs
- ScaleTransform3D.cs
- SHA512.cs
- XmlAttributeOverrides.cs
- DPCustomTypeDescriptor.cs
- EntityDataSourceContainerNameItem.cs
- WebPartConnectionsConfigureVerb.cs
- MouseBinding.cs
- ComponentManagerBroker.cs
- DrawingContextDrawingContextWalker.cs
- TagMapInfo.cs
- RubberbandSelector.cs
- MULTI_QI.cs
- GcHandle.cs
- Evidence.cs
- TimeSpanMinutesConverter.cs
- HtmlInputPassword.cs
- EventProviderWriter.cs
- SqlServer2KCompatibilityCheck.cs
- DesignerRegion.cs
- AttachedPropertyMethodSelector.cs
- WsrmFault.cs
- SystemIcmpV4Statistics.cs
- XPathSelfQuery.cs
- ICspAsymmetricAlgorithm.cs
- CaseInsensitiveComparer.cs
- ResourceReader.cs
- TreeNodeBinding.cs
- ConfigurationLocation.cs
- DataViewManager.cs
- wmiutil.cs
- XPathNodeList.cs
- GroupQuery.cs
- GuidTagList.cs
- MultiSelector.cs
- TypeLibConverter.cs
- ECDiffieHellmanPublicKey.cs
- XamlSerializationHelper.cs
- GeometryGroup.cs
- CngAlgorithm.cs
- RevocationPoint.cs
- ControlParser.cs
- Module.cs
- ColumnClickEvent.cs
- WorkflowInstanceExtensionManager.cs
- DiffuseMaterial.cs