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
- ServerTooBusyException.cs
- ElementNotAvailableException.cs
- XmlChildNodes.cs
- StateMachine.cs
- StringDictionary.cs
- DrawingCollection.cs
- SctClaimDictionary.cs
- ExpressionParser.cs
- FormViewCommandEventArgs.cs
- ServerValidateEventArgs.cs
- UnsafeNativeMethodsTablet.cs
- DoubleLinkList.cs
- DirectoryObjectSecurity.cs
- CustomLineCap.cs
- ProxyWebPart.cs
- BinaryUtilClasses.cs
- ItemsControlAutomationPeer.cs
- ClientFormsAuthenticationMembershipProvider.cs
- FilterQueryOptionExpression.cs
- TypefaceCollection.cs
- PermissionAttributes.cs
- Publisher.cs
- PersonalizableAttribute.cs
- DoubleAnimationClockResource.cs
- CodeArrayCreateExpression.cs
- SmuggledIUnknown.cs
- ToolStripContentPanel.cs
- PeerTransportElement.cs
- FunctionDescription.cs
- DataTemplateSelector.cs
- HttpListenerRequest.cs
- ValidationRuleCollection.cs
- SelfIssuedAuthProofToken.cs
- PerfCounters.cs
- KeyBinding.cs
- ProjectedWrapper.cs
- FigureHelper.cs
- CommonXSendMessage.cs
- Int16Storage.cs
- securestring.cs
- DiscoveryOperationContext.cs
- SqlRowUpdatingEvent.cs
- BrowserDefinitionCollection.cs
- SmtpTransport.cs
- CustomTypeDescriptor.cs
- ImageFormatConverter.cs
- DataControlLinkButton.cs
- BlurBitmapEffect.cs
- RegexCode.cs
- TextOptionsInternal.cs
- PostBackOptions.cs
- CodeDirectiveCollection.cs
- MessageQueueAccessControlEntry.cs
- HyperlinkAutomationPeer.cs
- CommandBinding.cs
- SqlRowUpdatedEvent.cs
- CLSCompliantAttribute.cs
- RadialGradientBrush.cs
- CompositionAdorner.cs
- Effect.cs
- DataGridViewCellStyleChangedEventArgs.cs
- LogLogRecord.cs
- ClientSession.cs
- NotCondition.cs
- ProcessHostServerConfig.cs
- ImageListStreamer.cs
- ObjectConverter.cs
- Matrix3DStack.cs
- MenuBindingsEditorForm.cs
- returneventsaver.cs
- HeaderFilter.cs
- DesignerLinkAdapter.cs
- TextFormatterHost.cs
- DataSourceControl.cs
- DPAPIProtectedConfigurationProvider.cs
- LinearGradientBrush.cs
- FastEncoderWindow.cs
- OleDbConnection.cs
- HttpHeaderCollection.cs
- C14NUtil.cs
- ServicePointManagerElement.cs
- RegexParser.cs
- KnownTypeDataContractResolver.cs
- Quad.cs
- TreeNodeCollection.cs
- ScriptControl.cs
- TextTreeDeleteContentUndoUnit.cs
- ReflectionServiceProvider.cs
- Utilities.cs
- XmlMapping.cs
- FormClosedEvent.cs
- XmlQualifiedName.cs
- ScopedKnownTypes.cs
- RegexInterpreter.cs
- CustomAttributeFormatException.cs
- ReceiveActivityDesignerTheme.cs
- BinaryUtilClasses.cs
- SoapObjectWriter.cs
- PermissionListSet.cs
- BoolExpr.cs