identity

How do I get the Current User identity for a VPN user in a Windows forms app?

We're currently developing a Windows Smartclient that needs to authenticate users using their AD group membership. We now have a requirement for some users to connect over VPN. Is there any way I can get the AD account identity and groups from the VPN login? WindowsIdentity.GetCurrent() returns the local user account rather than their ...

Java hashcode based on identity

The default behavior of Object.hashCode() is to return essentially the "address" of the object so that a.hashCode() == b.hashCode() if and only if a == b. How can I get this behavior in a user-defined class if a superclass already defines hashCode()? For instance: class A { public int hashCode() { return 0; } } class B extends...

mutable fields for objects in a Java Set

Am I correct in assuming that if you have an object that is contained inside a Java Set<> (or as a key in a Map<> for that matter), any fields that are used to determine identity or relation (via hashCode(), equals(), compareTo() etc.) cannot be changed without causing unspecified behavior for operations on the collection? (edit: as allu...

Identifying indentity column?

I have found out how to determine what columns are are primary key column of a given table by using this query: SELECT CONSTRAINT_NAME, COLUMN_NAME FROM INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE WHERE TABLE_NAME='tablename_here' AND CONSTRAINT_NAME LIKE 'PK_%' I can find out what the identity seed and increment is by using this ...

How to execute SELECT and INSERT in single query with PHP/MYSQL?

I have a table user_name with 3 fields, id, Name, Email (id is auto_increment field). I want to execute the following query in PHP, but its not returning any result. INSERT INTO user_name (Name, Email) VALUES ('Example', '[email protected]'); SELECT LAST_INSERT_ID() AS 'userid'; When I am executing the above query in PHP as below then ...

Best Practices for Security Questions in Web Apps

I'm working on a web applications where - believe it or not- the users aren't required to provide their email address to sign up. These requirements can not change. The users will login to the system with an id and password just like any standard web site. The problem I'm facing has to do with user's that have forgotten their password...

Oracle and auto_increment/identity

In modern versions of Oracle, is there some "standard" (stored procedure, additional CREATE syntax, etc.) way to setting up a table with auto_increment/identity style column, or are we still stuck manually creating the table, creating the sequence, and creating the trigger. Update: I realize Oracle has no concept of an auto_increment. ...

Show us your best obfuscated identity function

Rules are simple. Write an obfuscated function in any language that takes in an integer and returns the same integer. Try to use math tricks and not language tricks. IE. Try to make your function portable. ...

Dependency in identity column values after multiple SQL inserts

If the next is right: There are SQL string with multiple inserts (using a stored procedure): "EXEC SPInsertData ... EXEC SPInsertData ... EXEC SPInsertData ..." The id in identity column, which is auto incremented, of every new record is smaller than the id of the next one. E.g. after executing the given SQL string the id of the first...

When would you ever set the increment value on a database identity field?

Given the table: CREATE TABLE Table1 ( UniqueID int IDENTITY(1,1) ...etc ) Now why would you ever set the increment to something other than 1? I can understand setting the initial seed value differently. For example if, say, you're creating one database table per month of data (e.g. Table1_082009, Table1_092009) and want to s...

WCF Proxy and userPrincipalName

We have a rather large application my team and I are developing that contains a number of WCF NetTCP-based services. The Windows service this system will be running under won't be a local account, but instead a standard domain user (with admin privileges on the servers hosting the service). In the middle of testing connectivity I ran int...

What approach can be used to extend WCF security beyond the current domain?

WCF has a rich security model, I hope everyone can agree upon that as a given. I recently came across a situation where our client applications (WCF based applications that leverage the user's credentials within the domain) needed to communicate with services we had to deploy to a data center outside of our domain and control. Conseque...

Fluent nHibernate no identity column in table...

How do I specify with fluent nHbiernate mapping for a table that doesn't have an identity column? I want something like this: public sealed class CustomerNewMap : ClassMap<CustomerNew>, IMap { public CustomerNewMap() { WithTable("customers_NEW"); Not.LazyLoad(); Not.Id(); // this is invalid... Ma...

How long does it take to create an identity column?

I have a table that have 40million records. What's best (faster)? Create a column directly in that table or create another table with identity column and insert data from first? If I create an identity column in the table that have 40million records, is it possible estimate how long does it take to create it? ...

Does serialization preserve object identity?

I am using the Java Serializable interface and the ObjectOutputStream to serialize objects (until now, this method has been sufficient for my purposes). My API relies on object identity for some operations and I’m wondering if it will be preserved by serialization. That is to say: if, for two arbitrary objects a and b, it holds a == b b...

Identifying anonymous users

If I had a poll on my site, and I didn't want to require a registration to vote, but I only wanted each visit one, how might I do this? Let's say a visitor from IP 123.34.243.57 visits the site and votes. Would it then be safe to disallow anyone from 123.34.243.* from voting? Is this a good strategy? What's another one? ...

[ASP.NET] How to set Thread.CurrentPrincipal for use throughout the application?

HEllo, In an ASP.net application I'm using Login control with custom membership provider that I wrote, and what I also want to do is to set Thread.CurrentPrincipal to my custom Principal object, just after the user is authenticated. I'm using the setter: Thread.CurrentPrincipal and it sets the Principal object for me but, on all the c...

How to insert into a table with just one IDENTITY column (SQL Express)

Pretty much the same as this question. But I can't seem to get this to work with SQL Server Express in Visual Studio 2008. Same Table layout, One column with identity and primary key. ...

Can I trace object identity using GetHashCode?

What is the use of GetHashCode()? Can I trace object identity using GetHashCode()? If so, could you provide an example? ...

Is there a practical way of migrating from identity columns to hilo keys?

I work with a database that depends heavily on identity columns. However as we have now moved all applications over to NHibernate I wanted to look into using HiLo as seems to be recommended with NHibernate. Are there any strategies to do this, or any common problems to watch out for? ...