• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java security and SSO question

 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

We would like to enable SSO between two servers.
The producer side uses this code:



I need to implement the consumer side.
The producer gave me the url to his server and asked me to append to the url two parameters: The message and the signature.
Can someone please help/explain me how to create those?

Thank you in advance
 
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Even though loading the private key from from file works, the preferred way is to keep it securely stored in a java KeyStore. Check out more about it at java.sun.com

Your question is little bit confusing and not clear as to what is that you want to do. I'm answering with my best understanding of the question.

Signing a piece of text (could be anything, like just a user id, or user id with url, etc), is two step process.

1. Create a message digest out of the text
2. Encrypt the message digest using the private key, which produces Signature.

Once signature is created, it should not be altered in anyway otherwise signature would be broken and consumer would not be able to validate it.

So in your case, if the consuming party requesting you to add the url, change your generateMessage() method to add the url parameter and sign that generated message.
[ July 03, 2008: Message edited by: Santhosh Kumar ]
 
Andrew Carney
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Santosh.

So in your case, if the consuming party requesting you to add the url, change your generateMessage() method to add the url parameter and sign that generated message.



Can you please provide me with a general code example for this?

Rgds,
Roy
 
Santhosh Kumar
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure if this is what you meant to ask as an example nevertheless I just modified your original code to add the url.

reply
    Bookmark Topic Watch Topic
  • New Topic