public void StoreAssociation(AssociationRelyingPartyType distinguishingFactor, Association assoc) { var assocRow = dataSet.Association.NewAssociationRow(); assocRow.DistinguishingFactor = distinguishingFactor.ToString(); assocRow.Handle = assoc.Handle; assocRow.Expires = assoc.Expires.ToLocalTime(); assocRow.PrivateData = assoc.SerializePrivateData(); dataSet.Association.AddAssociationRow(assocRow); }
public bool RemoveAssociation(AssociationRelyingPartyType distinguishingFactor, string handle) { var keyWithoutHandle = "assoc-" + distinguishingFactor.ToString(); var keyWithHandle = keyWithoutHandle + "-" + handle; // lack of short-circuit here is important, both these calls need to run return(Current.RemoveFromCache(keyWithoutHandle) | Current.RemoveFromCache(keyWithHandle)); }
public bool RemoveAssociation(AssociationRelyingPartyType distinguishingFactor, string handle) { var row = dataSet.Association.FindByDistinguishingFactorHandle(distinguishingFactor.ToString(), handle); if (row != null) { dataSet.Association.RemoveAssociationRow(row); return true; } else { return false; } }
public Association GetAssociation(AssociationRelyingPartyType distinguishingFactor, SecuritySettings securityRequirements) { var keyWithoutHandle = "assoc-" + distinguishingFactor.ToString(); var wrapper = Current.GetFromCache<Wrapper>(keyWithoutHandle); if(wrapper == null) return null; return Association.Deserialize(wrapper.Handle, wrapper.Expires, wrapper.PrivateData); }
public Association GetAssociation(AssociationRelyingPartyType distinguishingFactor, string handle) { var keyWithHandle = "assoc-" + distinguishingFactor.ToString() + "-" + handle; var wrapper = Current.GetFromCache<Wrapper>(keyWithHandle); if (wrapper == null) return null; return Association.Deserialize(wrapper.Handle, wrapper.Expires, wrapper.PrivateData); }
public Association GetAssociation(AssociationRelyingPartyType distinguishingFactor) { // properly escape the URL to prevent injection attacks. string value = distinguishingFactor.ToString(); string filter = string.Format(CultureInfo.InvariantCulture, "{0} = '{1}'", dataSet.Association.DistinguishingFactorColumn.ColumnName, value); string sort = dataSet.Association.ExpiresColumn.ColumnName + " DESC"; DataView view = new DataView(dataSet.Association, filter, sort, DataViewRowState.CurrentRows); if (view.Count == 0) return null; var row = (CustomStoreDataSet.AssociationRow)view[0].Row; return Association.Deserialize(row.Handle, row.Expires.ToUniversalTime(), row.PrivateData); }
public Association GetAssociation(AssociationRelyingPartyType distinguishingFactor, SecuritySettings securityRequirements) { var keyWithoutHandle = "assoc-" + distinguishingFactor.ToString(); var wrapper = Current.GetFromCache <Wrapper>(keyWithoutHandle); if (wrapper == null) { return(null); } return(Association.Deserialize(wrapper.Handle, wrapper.Expires, wrapper.PrivateData)); }
public Association GetAssociation(AssociationRelyingPartyType distinguishingFactor, string handle) { var keyWithHandle = "assoc-" + distinguishingFactor.ToString() + "-" + handle; var wrapper = Current.GetFromCache <Wrapper>(keyWithHandle); if (wrapper == null) { return(null); } return(Association.Deserialize(wrapper.Handle, wrapper.Expires, wrapper.PrivateData)); }
public bool RemoveAssociation(AssociationRelyingPartyType distinguishingFactor, string handle) { var row = dataSet.Association.FindByDistinguishingFactorHandle(distinguishingFactor.ToString(), handle); if (row != null) { dataSet.Association.RemoveAssociationRow(row); return(true); } else { return(false); } }
public Association GetAssociation(AssociationRelyingPartyType distinguishingFactor) { // properly escape the URL to prevent injection attacks. string value = distinguishingFactor.ToString(); string filter = string.Format(CultureInfo.InvariantCulture, "{0} = '{1}'", dataSet.Association.DistinguishingFactorColumn.ColumnName, value); string sort = dataSet.Association.ExpiresColumn.ColumnName + " DESC"; DataView view = new DataView(dataSet.Association, filter, sort, DataViewRowState.CurrentRows); if (view.Count == 0) { return(null); } var row = (CustomStoreDataSet.AssociationRow)view[0].Row; return(Association.Deserialize(row.Handle, row.Expires.ToUniversalTime(), row.PrivateData)); }
public void StoreAssociation(AssociationRelyingPartyType distinguishingFactor, Association association) { var keyWithoutHandle = "assoc-" + distinguishingFactor.ToString(); var keyWithHandle = keyWithoutHandle + "-" + association.Handle; var expireIn = association.Expires - Current.Now; var @private = association.SerializePrivateData(); var newRecord = new Wrapper { Expires = association.Expires, PrivateData = @private, Handle = association.Handle }; Current.AddToCache(keyWithoutHandle, newRecord, expireIn); Current.AddToCache(keyWithHandle, newRecord, expireIn); }
public Association GetAssociation(AssociationRelyingPartyType distinguishingFactor, string handle) { var assocRow = dataSet.Association.FindByDistinguishingFactorHandle(distinguishingFactor.ToString(), handle); return Association.Deserialize(assocRow.Handle, assocRow.Expires, assocRow.PrivateData); }
public bool RemoveAssociation(AssociationRelyingPartyType distinguishingFactor, string handle) { var keyWithoutHandle = "assoc-" + distinguishingFactor.ToString(); var keyWithHandle = keyWithoutHandle + "-" + handle; // lack of short-circuit here is important, both these calls need to run return Current.RemoveFromCache(keyWithoutHandle) | Current.RemoveFromCache(keyWithHandle); }
public Association GetAssociation(AssociationRelyingPartyType distinguishingFactor, string handle) { var assocRow = dataSet.Association.FindByDistinguishingFactorHandle(distinguishingFactor.ToString(), handle); return(Association.Deserialize(assocRow.Handle, assocRow.Expires, assocRow.PrivateData)); }