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
- ProfileService.cs
- XmlFormatWriterGenerator.cs
- ConfigXmlComment.cs
- _ChunkParse.cs
- DataContractJsonSerializer.cs
- XmlException.cs
- GroupItemAutomationPeer.cs
- EmbeddedMailObject.cs
- SerializationEventsCache.cs
- Brushes.cs
- RadioButtonAutomationPeer.cs
- AnnotationObservableCollection.cs
- NetworkInformationException.cs
- DataGridViewTextBoxColumn.cs
- ModifyActivitiesPropertyDescriptor.cs
- ConfigurationSettings.cs
- SelfIssuedAuthRSAPKCS1SignatureDeformatter.cs
- RoleManagerEventArgs.cs
- ImageListUtils.cs
- GridViewRowPresenter.cs
- shaperfactoryquerycachekey.cs
- unsafenativemethodsother.cs
- AttachedProperty.cs
- PathStreamGeometryContext.cs
- LinkTarget.cs
- EventWaitHandle.cs
- IntegerValidatorAttribute.cs
- SocketAddress.cs
- ApplyImportsAction.cs
- PropertyPushdownHelper.cs
- ListViewDataItem.cs
- ApplicationManager.cs
- WebBrowser.cs
- RegexRunnerFactory.cs
- Timer.cs
- Transform.cs
- InvalidAsynchronousStateException.cs
- CompositeActivityCodeGenerator.cs
- _ListenerRequestStream.cs
- HostingEnvironment.cs
- DataListAutoFormat.cs
- GenericArgumentsUpdater.cs
- ArgumentOutOfRangeException.cs
- CardSpaceException.cs
- MetadataProperty.cs
- InvalidWMPVersionException.cs
- OdbcCommand.cs
- BaseCodePageEncoding.cs
- SecurityHeaderTokenResolver.cs
- TransformerInfo.cs
- BrowserDefinition.cs
- LinearKeyFrames.cs
- UdpTransportBindingElement.cs
- TextContainerChangedEventArgs.cs
- UnsafeNativeMethodsMilCoreApi.cs
- MethodToken.cs
- FileRecordSequence.cs
- FirstMatchCodeGroup.cs
- EntryPointNotFoundException.cs
- UrlMappingCollection.cs
- OutputCacheProfile.cs
- UnorderedHashRepartitionStream.cs
- ReferencedAssembly.cs
- CharacterHit.cs
- LayoutTableCell.cs
- Mutex.cs
- StateMachineWorkflow.cs
- NullableConverter.cs
- RuntimeHelpers.cs
- EnvironmentPermission.cs
- CommandConverter.cs
- SqlDataReaderSmi.cs
- SecurityManager.cs
- OleDbWrapper.cs
- Configuration.cs
- WebPartUtil.cs
- ImageClickEventArgs.cs
- FileUpload.cs
- PreProcessInputEventArgs.cs
- XmlAtomicValue.cs
- ProtocolsConfiguration.cs
- DocumentPageHost.cs
- NotImplementedException.cs
- DecimalAnimationBase.cs
- ConcurrencyBehavior.cs
- ObjectConverter.cs
- __Error.cs
- EmptyReadOnlyDictionaryInternal.cs
- SpotLight.cs
- BlockCollection.cs
- DurationConverter.cs
- HostingEnvironmentException.cs
- RegexMatchCollection.cs
- SqlCacheDependencySection.cs
- ConfigurationSectionHelper.cs
- CreateUserWizard.cs
- CodeBinaryOperatorExpression.cs
- PolicyStatement.cs
- formatstringdialog.cs
- ViewGenerator.cs