Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / IdentityModel / System / IdentityModel / Tokens / UserNameSecurityToken.cs / 1305376 / UserNameSecurityToken.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IdentityModel.Tokens { using System.Collections.ObjectModel; public class UserNameSecurityToken : SecurityToken { string id; string password; string userName; DateTime effectiveTime; public UserNameSecurityToken(string userName, string password) : this(userName, password, SecurityUniqueId.Create().Value) { } public UserNameSecurityToken(string userName, string password, string id) { if (userName == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("userName"); if (userName == string.Empty) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(SR.GetString(SR.UserNameCannotBeEmpty)); this.userName = userName; this.password = password; this.id = id; this.effectiveTime = DateTime.UtcNow; } public override string Id { get { return this.id; } } public override ReadOnlyCollectionSecurityKeys { get { return EmptyReadOnlyCollection .Instance; } } public override DateTime ValidFrom { get { return this.effectiveTime; } } public override DateTime ValidTo { // Never expire get { return SecurityUtils.MaxUtcDateTime; } } public string UserName { get { return this.userName; } } public string Password { get { return this.password; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IdentityModel.Tokens { using System.Collections.ObjectModel; public class UserNameSecurityToken : SecurityToken { string id; string password; string userName; DateTime effectiveTime; public UserNameSecurityToken(string userName, string password) : this(userName, password, SecurityUniqueId.Create().Value) { } public UserNameSecurityToken(string userName, string password, string id) { if (userName == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("userName"); if (userName == string.Empty) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(SR.GetString(SR.UserNameCannotBeEmpty)); this.userName = userName; this.password = password; this.id = id; this.effectiveTime = DateTime.UtcNow; } public override string Id { get { return this.id; } } public override ReadOnlyCollection SecurityKeys { get { return EmptyReadOnlyCollection .Instance; } } public override DateTime ValidFrom { get { return this.effectiveTime; } } public override DateTime ValidTo { // Never expire get { return SecurityUtils.MaxUtcDateTime; } } public string UserName { get { return this.userName; } } public string Password { get { return this.password; } } } } // 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
- BCryptHashAlgorithm.cs
- TransformValueSerializer.cs
- PartialList.cs
- DataGridTablesFactory.cs
- DefaultTraceListener.cs
- DetailsViewDeletedEventArgs.cs
- QilNode.cs
- UpdatableWrapper.cs
- DataProtection.cs
- IntMinMaxAggregationOperator.cs
- SqlWebEventProvider.cs
- BindingsCollection.cs
- HttpCapabilitiesEvaluator.cs
- UTF8Encoding.cs
- Matrix3DConverter.cs
- CurrencyWrapper.cs
- InternalPermissions.cs
- UDPClient.cs
- Span.cs
- InfoCardPolicy.cs
- UnicastIPAddressInformationCollection.cs
- DataMemberAttribute.cs
- EntityViewGenerationAttribute.cs
- TableLayoutSettingsTypeConverter.cs
- WebPartConnectionsDisconnectVerb.cs
- LineBreakRecord.cs
- StagingAreaInputItem.cs
- WebPartEventArgs.cs
- DecoderNLS.cs
- ListSortDescriptionCollection.cs
- GAC.cs
- ResolvedKeyFrameEntry.cs
- Trace.cs
- InkCanvasFeedbackAdorner.cs
- PtsHelper.cs
- HttpAsyncResult.cs
- DomainLiteralReader.cs
- DataGridViewColumnEventArgs.cs
- DataSysAttribute.cs
- ContentType.cs
- RootProfilePropertySettingsCollection.cs
- CodeCastExpression.cs
- CheckBoxStandardAdapter.cs
- RecognitionResult.cs
- CodeAttributeArgumentCollection.cs
- SortKey.cs
- ToolBar.cs
- FormView.cs
- HandlerBase.cs
- MemoryStream.cs
- ResolveInfo.cs
- StylusPointDescription.cs
- EventData.cs
- BindingCollection.cs
- WorkerRequest.cs
- SerializationStore.cs
- ControlCollection.cs
- PolicyLevel.cs
- OverflowException.cs
- AttributeTable.cs
- MetadataArtifactLoaderComposite.cs
- HttpModuleActionCollection.cs
- ContainsRowNumberChecker.cs
- WebReferencesBuildProvider.cs
- ReaderWriterLockWrapper.cs
- XPathException.cs
- Hyperlink.cs
- ControlLocalizer.cs
- HttpResponseWrapper.cs
- DataControlPagerLinkButton.cs
- SystemThemeKey.cs
- SerializationStore.cs
- WebPartCancelEventArgs.cs
- EntityViewGenerationAttribute.cs
- BaseTemplateCodeDomTreeGenerator.cs
- DataPagerCommandEventArgs.cs
- XhtmlCssHandler.cs
- SapiRecoInterop.cs
- MergeFilterQuery.cs
- Compilation.cs
- EasingKeyFrames.cs
- CallbackTimeoutsElement.cs
- Button.cs
- ExitEventArgs.cs
- RuleSetReference.cs
- XmlDigitalSignatureProcessor.cs
- LocationInfo.cs
- DetailsViewCommandEventArgs.cs
- SemanticTag.cs
- WindowPattern.cs
- pingexception.cs
- ToggleProviderWrapper.cs
- AutoGeneratedFieldProperties.cs
- WorkflowInlining.cs
- SchemaCollectionCompiler.cs
- DesignTimeVisibleAttribute.cs
- KeyNotFoundException.cs
- RealizationContext.cs
- ColorInterpolationModeValidation.cs
- BidOverLoads.cs