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
- TableRowCollection.cs
- WindowsPrincipal.cs
- TimeIntervalCollection.cs
- BreakSafeBase.cs
- COAUTHINFO.cs
- Matrix.cs
- StylusCaptureWithinProperty.cs
- SqlBuffer.cs
- HyperLinkColumn.cs
- HostedElements.cs
- TableColumnCollection.cs
- BindableTemplateBuilder.cs
- FilterQueryOptionExpression.cs
- FloaterParagraph.cs
- UserPreferenceChangedEventArgs.cs
- DataObjectPastingEventArgs.cs
- ParallelDesigner.cs
- ButtonRenderer.cs
- InvalidOleVariantTypeException.cs
- LinkClickEvent.cs
- WindowsIdentity.cs
- HttpCacheVary.cs
- FixedSOMPageConstructor.cs
- mongolianshape.cs
- DataGridViewRowCancelEventArgs.cs
- DropSourceBehavior.cs
- CustomPopupPlacement.cs
- OracleColumn.cs
- PropertyValueChangedEvent.cs
- PermissionAttributes.cs
- StreamMarshaler.cs
- GroupLabel.cs
- XmlTextReaderImplHelpers.cs
- ResourceCodeDomSerializer.cs
- RbTree.cs
- DetailsViewInsertedEventArgs.cs
- CounterCreationDataCollection.cs
- DataGridTableCollection.cs
- DataProtection.cs
- FontFamilyValueSerializer.cs
- DateTimeOffsetStorage.cs
- KeyToListMap.cs
- MetabaseServerConfig.cs
- GridPatternIdentifiers.cs
- DrawingAttributeSerializer.cs
- ZipPackagePart.cs
- TerminateDesigner.cs
- LayoutEditorPart.cs
- InvokerUtil.cs
- _StreamFramer.cs
- AbsoluteQuery.cs
- FileStream.cs
- _BasicClient.cs
- HwndStylusInputProvider.cs
- FormatStringEditor.cs
- BufferedWebEventProvider.cs
- UnsafeMethods.cs
- CodeArrayCreateExpression.cs
- Window.cs
- TextSelectionProcessor.cs
- MsmqBindingBase.cs
- ProgressiveCrcCalculatingStream.cs
- WebSysDescriptionAttribute.cs
- MetadataItem_Static.cs
- ProfileModule.cs
- _SecureChannel.cs
- EntityDataSourceDesigner.cs
- GroupQuery.cs
- StatusBar.cs
- xmlfixedPageInfo.cs
- LayoutInformation.cs
- QueryExtender.cs
- EventArgs.cs
- FlowDocumentPageViewerAutomationPeer.cs
- AnnotationStore.cs
- PaintEvent.cs
- TcpProcessProtocolHandler.cs
- IdentifierService.cs
- GeneralTransform3D.cs
- RequestCacheManager.cs
- XPathScanner.cs
- FixedPage.cs
- XXXOnTypeBuilderInstantiation.cs
- HtmlTableRowCollection.cs
- ChildTable.cs
- IndexedWhereQueryOperator.cs
- FormsAuthenticationTicket.cs
- ProviderSettings.cs
- ImageClickEventArgs.cs
- NotifyParentPropertyAttribute.cs
- ThreadStateException.cs
- RemotingSurrogateSelector.cs
- _Win32.cs
- TypefaceMap.cs
- RelationshipFixer.cs
- BinaryObjectInfo.cs
- ObjectComplexPropertyMapping.cs
- ArraySubsetEnumerator.cs
- COM2Properties.cs
- KeyNotFoundException.cs