Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Curious Question relating username and password...  RSS feed

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

I just have a curious question that comes to my mind.

Is it possible to have two members ( or users ) having the same username but different passwords.

say,

username for user1 and user2 is "apple".

but the password for user1 is "orange" and password for user2 is "pineapple".

Is it possible??? Are they allowed to have them???

Thanks in advanced.

Philip
 
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Philip Zac wrote:Is it possible to have two members ( or users ) having the same username but different passwords.


What would you think ? What If your JR user name(login) is same like mine, say "philip", then whose post/account/PM the JR is supposed to show ?
 
Marshal
Posts: 59742
188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure. Don't think so, no, however.
 
Philip Zac
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Sagar and Campbell,

I thought there should be something to compare the username and password for a particular user. If there is same username, but different password, then it checks the comparsion of password and then assigned to that user.

Thanks

Philip
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Philip Zac wrote:If there is same username, but different password, then it checks the comparsion of password and then assigned to that user.


And what will happen, if both user sets the same password.

Philip ,
Consider, the username:password as "key:value" pair, and there shouldn't be any duplicate key.
 
Philip Zac
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Sagar ... Got it..

Philip
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My Pleasure
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, I think you have to make the username and password both unique. you can do it by comparing the new entered username and password both unique by comparing with the existing ones by using the compareToIgnoreCase function in a loop.
 
Bartender
Posts: 2633
17
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Abhik Ghosh wrote:No, I think you have to make the username and password both unique. you can do it by comparing the new entered username and password both unique by comparing with the existing ones by using the compareToIgnoreCase function in a loop.

In most databases, the password is stored as a hashed value. No way you can compare them. If two users use the same password, their password will not appear the same in a decent database.
 
Abhik Ghosh
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks jan, you are right.. so we only make the username unique..
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!