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
- DrawToolTipEventArgs.cs
- HtmlInputText.cs
- OdbcCommand.cs
- QilIterator.cs
- Freezable.cs
- CacheSection.cs
- XmlnsCompatibleWithAttribute.cs
- Soap.cs
- CheckBoxPopupAdapter.cs
- EventLogPermissionAttribute.cs
- SystemIcons.cs
- OutputWindow.cs
- ToolStripPanelRenderEventArgs.cs
- ModelItemDictionaryImpl.cs
- ParameterElement.cs
- UnwrappedTypesXmlSerializerManager.cs
- __FastResourceComparer.cs
- Config.cs
- DataControlButton.cs
- ScriptResourceAttribute.cs
- DoubleAnimationBase.cs
- PassportAuthenticationEventArgs.cs
- BoolExpr.cs
- DbgUtil.cs
- TdsEnums.cs
- BulletedListEventArgs.cs
- Invariant.cs
- CodeIdentifiers.cs
- MarkupProperty.cs
- WebPartConnectionsConfigureVerb.cs
- RootBuilder.cs
- DragDeltaEventArgs.cs
- StaticSiteMapProvider.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- HttpServerVarsCollection.cs
- NotSupportedException.cs
- input.cs
- ReversePositionQuery.cs
- CodeDomSerializationProvider.cs
- DirectoryInfo.cs
- PassportAuthenticationEventArgs.cs
- MatrixTransform3D.cs
- DispatcherTimer.cs
- UnsafeNetInfoNativeMethods.cs
- InputMethodStateTypeInfo.cs
- DragDeltaEventArgs.cs
- DataGridViewElement.cs
- TemplateDefinition.cs
- EndEvent.cs
- DeferredElementTreeState.cs
- FamilyTypefaceCollection.cs
- GB18030Encoding.cs
- EmptyEnumerator.cs
- SettingsProviderCollection.cs
- TreeViewDesigner.cs
- precedingsibling.cs
- ToolStripPanelCell.cs
- XpsPackagingPolicy.cs
- PointLightBase.cs
- ComplexType.cs
- TraceFilter.cs
- ValidationPropertyAttribute.cs
- ComplexBindingPropertiesAttribute.cs
- IPGlobalProperties.cs
- TagMapCollection.cs
- PerfCounterSection.cs
- InvalidAsynchronousStateException.cs
- MemberInfoSerializationHolder.cs
- ByteConverter.cs
- PaperSize.cs
- xmlfixedPageInfo.cs
- DbDataAdapter.cs
- ConnectionsZone.cs
- CodeDirectoryCompiler.cs
- SecurityContextSecurityToken.cs
- MethodToken.cs
- ConnectionPoint.cs
- SchemaSetCompiler.cs
- RegionInfo.cs
- ForeignKeyConstraint.cs
- DataGridCommandEventArgs.cs
- ClientProxyGenerator.cs
- ImageField.cs
- ExpandSegment.cs
- SelectionRange.cs
- DataGridCaption.cs
- FilteredAttributeCollection.cs
- StrokeFIndices.cs
- WindowsButton.cs
- EncryptedData.cs
- PlainXmlWriter.cs
- OracleDateTime.cs
- DbProviderManifest.cs
- XPathSingletonIterator.cs
- TypeExtension.cs
- EntityCollectionChangedParams.cs
- DoubleAverageAggregationOperator.cs
- Queue.cs
- RegexCode.cs
- ProgressiveCrcCalculatingStream.cs