Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / IdentityModel / System / IdentityModel / Selectors / SecurityTokenAuthenticator.cs / 1305376 / SecurityTokenAuthenticator.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IdentityModel.Selectors { using System.Collections.ObjectModel; using System.IdentityModel.Policy; using System.IdentityModel.Tokens; public abstract class SecurityTokenAuthenticator { protected SecurityTokenAuthenticator() { } public bool CanValidateToken(SecurityToken token) { if (token == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("token"); } return this.CanValidateTokenCore(token); } public ReadOnlyCollectionValidateToken(SecurityToken token) { if (token == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("token"); } if (!CanValidateToken(token)) { // warning 56506: Parameter 'token' to this public method must be validated: A null-dereference can occur here. #pragma warning suppress 56506 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenValidationException(SR.GetString(SR.CannotValidateSecurityTokenType, this, token.GetType()))); } ReadOnlyCollection authorizationPolicies = ValidateTokenCore(token); if (authorizationPolicies == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenValidationException(SR.GetString(SR.CannotValidateSecurityTokenType, this, token.GetType()))); } return authorizationPolicies; } protected abstract bool CanValidateTokenCore(SecurityToken token); protected abstract ReadOnlyCollection ValidateTokenCore(SecurityToken token); } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IdentityModel.Selectors { using System.Collections.ObjectModel; using System.IdentityModel.Policy; using System.IdentityModel.Tokens; public abstract class SecurityTokenAuthenticator { protected SecurityTokenAuthenticator() { } public bool CanValidateToken(SecurityToken token) { if (token == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("token"); } return this.CanValidateTokenCore(token); } public ReadOnlyCollection ValidateToken(SecurityToken token) { if (token == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("token"); } if (!CanValidateToken(token)) { // warning 56506: Parameter 'token' to this public method must be validated: A null-dereference can occur here. #pragma warning suppress 56506 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenValidationException(SR.GetString(SR.CannotValidateSecurityTokenType, this, token.GetType()))); } ReadOnlyCollection authorizationPolicies = ValidateTokenCore(token); if (authorizationPolicies == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SecurityTokenValidationException(SR.GetString(SR.CannotValidateSecurityTokenType, this, token.GetType()))); } return authorizationPolicies; } protected abstract bool CanValidateTokenCore(SecurityToken token); protected abstract ReadOnlyCollection ValidateTokenCore(SecurityToken token); } } // 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
- DrawingContextDrawingContextWalker.cs
- ImmutableClientRuntime.cs
- Bitmap.cs
- MsmqChannelListenerBase.cs
- RuleSettings.cs
- ScriptReference.cs
- SerializerWriterEventHandlers.cs
- _ServiceNameStore.cs
- StreamDocument.cs
- InputBindingCollection.cs
- SplashScreen.cs
- COM2IManagedPerPropertyBrowsingHandler.cs
- CatchDesigner.xaml.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- columnmapfactory.cs
- SmiXetterAccessMap.cs
- TextChangedEventArgs.cs
- XmlSchemaSimpleContent.cs
- BulletedList.cs
- FaultReasonText.cs
- ApplicationSettingsBase.cs
- IChannel.cs
- CryptoHelper.cs
- WebPartVerb.cs
- OpacityConverter.cs
- FileCodeGroup.cs
- TextTabProperties.cs
- BooleanToVisibilityConverter.cs
- EventPrivateKey.cs
- MD5.cs
- XmlElementElementCollection.cs
- ModulesEntry.cs
- SqlPersonalizationProvider.cs
- ParserStack.cs
- SiteMapSection.cs
- NameValuePair.cs
- PackageDigitalSignature.cs
- ArithmeticException.cs
- xsdvalidator.cs
- ToolBarTray.cs
- DataObjectCopyingEventArgs.cs
- CombinedGeometry.cs
- XmlUTF8TextWriter.cs
- SafeSystemMetrics.cs
- WindowsTab.cs
- GatewayIPAddressInformationCollection.cs
- ElementHostPropertyMap.cs
- EnumConverter.cs
- URIFormatException.cs
- RequestChannel.cs
- SqlFunctionAttribute.cs
- EventLogPermissionHolder.cs
- MatrixTransform.cs
- SrgsText.cs
- BitmapPalettes.cs
- Connector.xaml.cs
- XPathMessageFilterElementCollection.cs
- VBCodeProvider.cs
- entitydatasourceentitysetnameconverter.cs
- Binding.cs
- TextReader.cs
- BulletDecorator.cs
- PermissionToken.cs
- TextShapeableCharacters.cs
- XhtmlConformanceSection.cs
- Int32Collection.cs
- BrowserCapabilitiesFactory35.cs
- PeerTransportSecurityElement.cs
- SafeArrayRankMismatchException.cs
- CustomExpressionEventArgs.cs
- VarRemapper.cs
- WindowAutomationPeer.cs
- StringHelper.cs
- XmlReflectionMember.cs
- NullPackagingPolicy.cs
- DBSqlParserColumn.cs
- NotifyCollectionChangedEventArgs.cs
- StandardCommands.cs
- BaseCollection.cs
- DesignerDataConnection.cs
- ProxyElement.cs
- sqlcontext.cs
- CodeSnippetCompileUnit.cs
- PropertyEmitterBase.cs
- DataControlReferenceCollection.cs
- FixedBufferAttribute.cs
- Label.cs
- TypeDescriptionProvider.cs
- RsaElement.cs
- UInt16Converter.cs
- AgileSafeNativeMemoryHandle.cs
- CodeTypeParameterCollection.cs
- DataGridItem.cs
- TreeIterators.cs
- InvalidEnumArgumentException.cs
- RoleGroupCollection.cs
- XmlRawWriterWrapper.cs
- TypeForwardedToAttribute.cs
- StatusBarDrawItemEvent.cs
- MultiPageTextView.cs