Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / xsp / System / Web / Configuration / PassportAuthentication.cs / 5 / 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.
//
//-----------------------------------------------------------------------------
/*****************************************************************************
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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ProfileService.cs
- PrtCap_Public.cs
- PartBasedPackageProperties.cs
- EndpointBehaviorElement.cs
- StylusPointProperties.cs
- ProfileService.cs
- DateRangeEvent.cs
- NamespaceExpr.cs
- SoapServerProtocol.cs
- TextBox.cs
- XmlDocumentFragment.cs
- StatusInfoItem.cs
- ISFClipboardData.cs
- MatchingStyle.cs
- figurelengthconverter.cs
- EncodingStreamWrapper.cs
- SymbolDocumentInfo.cs
- EntityViewGenerationConstants.cs
- MaterialGroup.cs
- FixedPageAutomationPeer.cs
- Site.cs
- HiddenField.cs
- ChineseLunisolarCalendar.cs
- AnnotationObservableCollection.cs
- InfoCardPolicy.cs
- XmlDataLoader.cs
- SerializerWriterEventHandlers.cs
- NativeCppClassAttribute.cs
- BadImageFormatException.cs
- Queue.cs
- TextLine.cs
- exports.cs
- ToolboxItemSnapLineBehavior.cs
- XmlReader.cs
- ActivationServices.cs
- FormsAuthenticationTicket.cs
- Command.cs
- InputMethod.cs
- AnnotationMap.cs
- BulletChrome.cs
- Rectangle.cs
- ClientProxyGenerator.cs
- Int64Converter.cs
- DataGridViewCellValidatingEventArgs.cs
- ConnectionModeReader.cs
- RegexCompiler.cs
- odbcmetadatacollectionnames.cs
- ValueTypeFieldReference.cs
- SQLBoolean.cs
- ReferentialConstraint.cs
- DataGridViewColumnHeaderCell.cs
- TextPointer.cs
- Item.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- ErrorFormatter.cs
- WindowsComboBox.cs
- TextWriter.cs
- XmlIlTypeHelper.cs
- ChannelListenerBase.cs
- OrderPreservingSpoolingTask.cs
- CodeTypeDelegate.cs
- RegistryHandle.cs
- RTLAwareMessageBox.cs
- CorrelationTokenInvalidatedHandler.cs
- EventManager.cs
- TargetInvocationException.cs
- MailHeaderInfo.cs
- XmlLinkedNode.cs
- Int32Storage.cs
- XmlElementCollection.cs
- ArraySortHelper.cs
- QuadraticBezierSegment.cs
- WindowsComboBox.cs
- ResXResourceWriter.cs
- contentDescriptor.cs
- MimeFormImporter.cs
- Literal.cs
- ClientBuildManagerCallback.cs
- Cursor.cs
- StateElement.cs
- DocumentSchemaValidator.cs
- UIElementAutomationPeer.cs
- XmlRawWriter.cs
- filewebresponse.cs
- RegionData.cs
- ArgumentsParser.cs
- TreeNode.cs
- BaseTemplateParser.cs
- SubMenuStyleCollection.cs
- ToolStripArrowRenderEventArgs.cs
- SqlNotificationEventArgs.cs
- TriggerCollection.cs
- TreeNodeBinding.cs
- OrCondition.cs
- DecimalFormatter.cs
- RequestStatusBarUpdateEventArgs.cs
- X509CertificateStore.cs
- clipboard.cs
- StylusPoint.cs
- SmiGettersStream.cs