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
- TreeViewDesigner.cs
- ImmComposition.cs
- QilLoop.cs
- BrowserCapabilitiesFactoryBase.cs
- ListenerBinder.cs
- LineSegment.cs
- _NestedMultipleAsyncResult.cs
- UserInitiatedNavigationPermission.cs
- EmptyCollection.cs
- AlternateViewCollection.cs
- LayoutTableCell.cs
- ZoneLinkButton.cs
- ScriptComponentDescriptor.cs
- WebPartActionVerb.cs
- TagNameToTypeMapper.cs
- ToolStripDropDownClosingEventArgs.cs
- MultilineStringConverter.cs
- GuidelineSet.cs
- QueryOptionExpression.cs
- FontStretches.cs
- DefaultClaimSet.cs
- ConfigurationManagerInternal.cs
- SizeAnimationUsingKeyFrames.cs
- RelationshipSet.cs
- StreamGeometry.cs
- ChildTable.cs
- DataGridAutomationPeer.cs
- TreeNodeCollection.cs
- WindowsAuthenticationModule.cs
- ReadOnlyObservableCollection.cs
- OciHandle.cs
- JsonQNameDataContract.cs
- HttpCacheVaryByContentEncodings.cs
- SafeLibraryHandle.cs
- SafePointer.cs
- ContextMenuStrip.cs
- TreeNodeMouseHoverEvent.cs
- UnknownBitmapDecoder.cs
- Misc.cs
- TypeDelegator.cs
- TogglePattern.cs
- Dispatcher.cs
- ConstantSlot.cs
- Int32AnimationBase.cs
- DES.cs
- ActivationServices.cs
- ScriptComponentDescriptor.cs
- SqlCommandBuilder.cs
- NotImplementedException.cs
- ConsoleTraceListener.cs
- CollectionViewGroupInternal.cs
- ActivityCompletionCallbackWrapper.cs
- PrivateFontCollection.cs
- PortCache.cs
- XmlTextAttribute.cs
- MarkupCompilePass2.cs
- SystemSounds.cs
- EntityDataSourceContainerNameItem.cs
- ProviderSettings.cs
- WorkflowServiceHostFactory.cs
- DesignerCapabilities.cs
- EventsTab.cs
- RegistryPermission.cs
- CodeDomSerializerBase.cs
- ArgumentOutOfRangeException.cs
- SystemIPv6InterfaceProperties.cs
- StringUtil.cs
- InitializerFacet.cs
- EventLogWatcher.cs
- XmlUtf8RawTextWriter.cs
- hresults.cs
- SQLByte.cs
- FilteredDataSetHelper.cs
- TransformCryptoHandle.cs
- EmptyQuery.cs
- SqlColumnizer.cs
- ApplicationManager.cs
- GAC.cs
- Latin1Encoding.cs
- DataGridViewIntLinkedList.cs
- RadioButtonRenderer.cs
- Selection.cs
- DataContext.cs
- IndexedEnumerable.cs
- VirtualizingPanel.cs
- VirtualPathUtility.cs
- DataPagerFieldItem.cs
- FixedSOMGroup.cs
- GuidConverter.cs
- RegexMatch.cs
- OdbcErrorCollection.cs
- DataDocumentXPathNavigator.cs
- UserPreferenceChangedEventArgs.cs
- DbDataRecord.cs
- ProvidePropertyAttribute.cs
- LayoutInformation.cs
- SQLMoneyStorage.cs
- StructuralType.cs
- OdbcConnectionFactory.cs
- XmlBinaryReader.cs