Glossary.
SAML - Security Assertion Markup Language is an XML standard for exchanging authentication and authorization data between security domains, that is, between an identity provider and a service provider.
SSO - Single sign-on (SSO) is a specialized form of software authentication that enables a user to authenticate once and gain access to the resources of multiple software systems.
Introduction.
Recently I have had to implement one part of SSO. My application as a provider of the services acts like a Relying Party in the SAML terms. Relying party is the system, or administrative domain, that relies on information supplied to it by the asserting party. While Asserting party is the system, or administrative domain, that asserts information about a subject. For instance, the asserting party asserts that this user has been authenticated and has given associated attributes.
In other words I am in B2B relation with my partners. We want to use SSO all across our services. And of course we want to use modern SAML as assertion contract language.
Finding solution.
In order to implement SSO with SAML you have to choose specification to which you conform. There are two of them 1.1 and 2.0. While 2.0 is more feature rich and restrictive, old 1.1 is more wide spread and accepted across business. Specification defines not only the SAML language itself, but also the way it can be used during assertions interchange. There are two possible ways of assertion flow for SSO purpose in 1.1 spec:
- Browser/Artifact Profile - this stand for the case when target service (the service end-user wants to access) asks another party to confirm end-user credentials. Actual assertion flow is more complicated (You can reference to actual specification part 4.1.1 for more details).
- Browser/POST Profile - in this case end-user submits his passport along with the reference to the target service he wants to access.
First case with artifact interchange is not suite for us. I have to initiate outgoing connection to trusted business partner site in order to obtain actual SAML assertion. I have to create request based on artifact supplied me earlier. To involve this kind of dependency is not a good idea for my particular application. I do not want to have a third party system access from inside my firewall. Altough, it is plain HTTP outgoing connection.
The second case with all-sufficient SAML assertion I like more. From the top level overview it looks simple as that:

End-User (browser) submit me (Relying party) ready to use passport (assertion). I trust this passport based in special trust relationship between me (Relying party) and asserting party who actually issued this passport.
The important note here is I do not mention how this trust relationship has been established. This space is for another article I expect to publish in near future.
Implementation.
It is a good point here to start from utilizing ready to use SAML library. There is open source library called opensaml which can handle most of the SAML related operations. This is quite fresh library from the implementation point of view. And some times I find very strange architectural decisions in it. However, and it is more important for us, it works! So let's take all OpenSAML abstraction into our design and proceed with diagramming.

At the first step, according to specification, browser post "Form with Response& Assertion" to our Servlet.
Note:
It is a little bit unusual here, why we submit response? In general it is clearer to submit requests. At least submit some kind of TransmitAssertionUnit, SAMLAssertionMessage or any other well suited for this particular satiation object name of the underlying abstraction.
At the second step we have to construct BrowserProfileRequest object. It encapsulates data submitted for us by Asserting party through user browser in HttpRequest.
At the third step we have to create binding profile we have chosen. In our case it is SAMLBrowserProfile. Let's use factory to create an instance and then perform response (actually, as I mentioned early it is request or just a message containing our assertion, but for some reason it is called BrowserProfileResponse) processing.
Once we have BrowserProfileResponse object we have all information necessary to perform all other operations. It can be trust relationship validation step (As I mentioned earlier. See the next post for details). It can be some kind of authentications steps in which we create internal object represents authenticated user. And finally, we can redirect user to requested resource.
Let's step ahead to actual coding. I want to have my servlet code clear. Thus let's introduce SsoSamlHelper here. This helper takes care of all implementation details. Then actual servlet looks like template method.
package org.ots.sso;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.opensaml.NoSuchProviderException;
import org.opensaml.SAMLAssertion;
import org.opensaml.SAMLBrowserProfile;
import org.opensaml.SAMLBrowserProfileFactory;
import org.opensaml.SAMLException;
import org.opensaml.SAMLSignedObject;
import org.opensaml.UnsupportedProfileException;
import org.opensaml.SAMLBrowserProfile.BrowserProfileRequest;
import org.opensaml.SAMLBrowserProfile.BrowserProfileResponse;
import org.ots.ws.security.KeyStoreHolder;
/**
* Useful static method to manipulate with SAML objects
*
* @version $Id$
* @author Roman Kuzmik
*/
public class SsoSamlHelper {
private static final Log log = LogFactory.getLog(SsoSamlHelper.class);
/**
* Exctract from HHTP request all SSO SAML related information
*
* @param httpRequest
* @return
* @throws SsoSamlException
*/
public static BrowserProfileRequest createRequest(HttpServletRequest httpRequest) throws SsoSamlException{
log.debug("");
try {
SAMLBrowserProfile profile = SAMLBrowserProfileFactory.getInstance();
BrowserProfileRequest samlRequest = profile.receive(httpRequest);
return samlRequest;
} catch (UnsupportedProfileException e) {
throw new SsoSamlException(e);
} catch (NoSuchProviderException e) {
throw new SsoSamlException(e);
}
}
/**
* Perform SAML assertion reconstruction from the BrowserProfileRequest provided
*
* @param samlRequest
* @return
* @throws SsoSamlException
*/
public static BrowserProfileResponse processRequest(BrowserProfileRequest samlRequest) throws SsoSamlException{
log.debug("");
try {
SAMLBrowserProfile profile = SAMLBrowserProfileFactory.getInstance();
StringBuffer issuerBuffer = new StringBuffer();
BrowserProfileResponse samlResponse = profile.receive(
issuerBuffer,
samlRequest,
SsoSamlConstants.SAML_SSO_RECEPIENT,
/*ReplayCache*/ null,
/*SAMLBrowserProfile.ArtifactMapper*/ null,
SsoSamlConstants.SAML_MINOR_VERSION
);
log.debug("done");
return samlResponse;
} catch (UnsupportedProfileException e) {
throw new SsoSamlException(e);
} catch (NoSuchProviderException e) {
throw new SsoSamlException(e);
} catch (SAMLException e) {
throw new SsoSamlException(e);
}
}
/**
* Give me trust entity key
*
* @param assertion
* @return
*/
public static String getIssuer(SAMLAssertion assertion){
return assertion.getIssuer().trim();
}
/**
* WS-S Signature validation
*
* @param samlObject
* @param issuer
* @param keyStoreHolder
* @throws SsoSamlException
*/
public static void verifySignature(SAMLSignedObject samlObject, String issuer, KeyStoreHolder keyStoreHolder) throws SsoSamlException{
log.debug("");
try {
samlObject.verify(keyStoreHolder.getPublicKey(issuer));
} catch (KeyStoreException e) {
throw new SsoSamlException(e);
} catch (NoSuchAlgorithmException e) {
throw new SsoSamlException(e);
} catch (UnrecoverableKeyException e) {
throw new SsoSamlException(e);
} catch (SAMLException e) {
throw new SsoSamlException(e);
}
log.debug("done");
}
}
Javadoc provided here should be self explanations.
Now we can construct our servlet in three lines of code as follows:
BrowserProfileRequest samlRequest = SsoSamlHelper.createRequest(httpRequest);
BrowserProfileResponse samlResponse = SsoSamlHelper.processRequest(samlRequest);
String issuer = SsoSamlHelper.getIssuer(samlResponse.assertion);
SsoSamlHelper.verifySignature(samlResponse.response, issuer, keyStoreHolder);
String nameIdentifier = samlResponse.authnStatement.getSubject().getNameIdentifier().getName();
//auth user with username==nameIdentifier
//redirect to samlRequest.TARGET
That's it!
Servlet out looks as follows:
10:10:27(DEBUG)[ws.security.KeyStoreHolder.initKeyStore():74]
10:10:27(DEBUG)[ws.security.KeyStoreHolder.initTrustStore():84]
10:10:27(DEBUG)[sso.SsoSamlServlet.service():42] [START]
10:10:27(DEBUG)[sso.SsoSamlServlet.service():45] read HTTP request into BrowserProfileRequest
10:10:27(DEBUG)[sso.SsoSamlHelper.createRequest():40]
10:10:27(DEBUG)[sso.SsoSamlServlet.service():47] samlRequest.SAMLResponse: base 64 code here
10:10:27(DEBUG)[sso.SsoSamlServlet.service():48] samlRequest.TARGET:target URL here
10:10:27(DEBUG)[sso.SsoSamlServlet.service():50] process BrowserProfileRequest into BrowserProfileResponse
10:10:27(DEBUG)[sso.SsoSamlHelper.processRequest():54]
10:10:28(DEBUG)[sso.SsoSamlHelper.processRequest():70] done
10:10:28(DEBUG)[sso.SsoSamlServlet.service():54] issuer: 'My partner #1'
10:10:28(DEBUG)[sso.SsoSamlServlet.service():56] verify response signature
10:10:28(DEBUG)[sso.SsoSamlHelper.verifySignature():86]
10:10:28(INFO) [security.signature.Reference.verify():742] Verification successful for URI "#cMnRtaOAdFkQmoCoQUdn"
10:10:28(DEBUG)[sso.SsoSamlHelper.verifySignature():98] done
10:10:28(DEBUG)[sso.SsoSamlServlet.service():59] perform authentication
10:10:28(DEBUG)[sso.SsoSamlServlet.service():61] nameIdentifier: hemaTest
10:10:28(DEBUG)[service.handler.SecurityManager.getUserPasswordFromSamlAssertion():39] retrieve runtime properties
10:10:28(DEBUG)[service.handler.SecurityManager.getUserPasswordFromSamlAssertion():43] companyName:My partner #1
10:10:28(DEBUG)[service.handler.SecurityManager.getUserPasswordFromSamlAssertion():44] loginId:partnerUser_1
10:10:28(DEBUG)[sso.SsoSamlServlet.service():69] perform HTTP redirect to: target URL here
10:10:28(DEBUG)[sso.SsoSamlServlet.service():80] [END]
Test: SAML Asserting party Implementation.
At this point we have to test our code. In order to do it we have to implement Asserting party. This includes "Inter-Site Transfer Service" implementation and all necessary parts for the browser functionality. This is definitely quite enough for the next article.
References.
www.opersaml.com - SAML 1.1 and 2.0 implementation
SAML 1.1 specifications

21 comments:
Hi Roman!
I would like to know, if it is possible to obtain (somehow) other classess used by You in this example? I'm new in SSO/SAML but I'm trying a learn-by-example approach. If you would be so kind and provide me this classess somehow (e.g. you could put them on Your site or post me by e-mail) I would be very gratefull.
I'm at your disposal under jchwastowska(no_spam)@gmail.com.
Thank you in advance.
Joanna
Yea ... I would also be interested in seeing the supporting classes
[b][url=http://cheap-car-insurance.quickfreehost.com] car insurance for woman [/url][/b]
[b][url=http://seoguide.ws] car insurance coverage [/url][/b]
[b][url=http://nutritionguide.ws] car insurance price [/url][/b]
[b][url=http://affiliaterevenueguide.ws] buy car insurance [/url][/b]
[b][url=http://careeremploymentguide.com] cheap car insurance online [/url][/b]
[b][url=http://fitnessequipmentguide.net] car insurance dallas [/url][/b]
[b][url=http://inetmarketingguide.ws] best car insurance company [/url][/b]
[b][url=http://interiordecorguide.ws] car insurance quote [/url][/b]
[b][url=http://landscapingguide.ws] car insurance broker [/url][/b]
[b][url=http://mortgageguide.ws] car
insurance philadelphia [/url][/b]
[b][url=http://personalfinanceguide.ws] online car insurance [/url][/b]
[b][url=http://trafficbuildingguide.net] car insurance comparison [/url][/b]
[b][url=http://vacationrentalsguide.ws] car accident insurance [/url][/b]
[b][url=http://wealthbuildingguide.net] churchil
l car insurance [/url][/b]
[b][url=http://progressive-car-insurance.wealthbuildingguide.net] churchil
l car insurance [/url][/b]
[b][url=http://compare-car-insurance.vacationrentalsguide.ws] geico car insurance quote [/url][/b]
[b][url=http://cheapest-car-insurance.trafficbuildingguide.net] nationwide car insurance [/url][/b]
[b][url=http://classic-car-insurance.personalfinanceguide.ws] aa car insurance [/url][/b]
[b][url=http://free-car-insurance-quote.mortgageguide.ws] tesco car insurance [/url][/b]
[b][url=http://cheap-car-insurance-quote.landscapingguide.ws] geico car insurance [/url][/b]
[b][url=http://low-cost-car-insurance.interiordecorguide.ws] car insurance quote canada [/url][/b]
[b][url=http://car-insurance-quote.inetmarketingguide.ws] car insurance chicago [/url][/b]
[b][url=http://car-insurance-rates.homeimprovementguide.ws] allstate car insurance [/url][/b]
[b][url=http://new-york-insurance.fitnessequipmentguide.net] instant car insurance quote [/url][/b]
[b][url=http://california-car-insurance.estateguide.ws] usaa car insurance [/url][/b]
[b][url=http://car-insurance-rate.careeremploymentguide.com] online car insurance [/url][/b]
[b][url=http://auto-insurance-company.affiliaterevenueguide.ws] online car insurance rate [/url][/b]
[b][url=http://online-car-insurance.acneguide.ws] best car insurance company [/url][/b]
[b][url=http://auto-cheap-insurance.nutritionguide.ws] car insurance coverage [/url][/b]
[b][url=http://auto-insurance-quote.seoguide.ws] best car insurance company [/url][/b]
http://cheap-car-insurance.quickfreehost.com
Random Keyword: :)
[b]aa car insurance[/b]
Hello!
Nice site, keep up the good work .
[url=http://buy-phentermine.hem.nu]http://buy-phentermine.hem.nu[/url] BUY PHENTERMINE
BUY PHENTERMINE
http://buy-phentermine.hem.nu buy phentermine
http://buy-phentermine.hem.nu phentermine online
http://buy-phentermine.hem.nu order phentermine
http://buy-phentermine.hem.nu cheap phentermine
http://buy-phentermine.hem.nu buy phentermine online
http://buy-phentermine.hem.nu phentermine diet pill
http://buy-phentermine.hem.nu phentermine online pharmacy
http://buy-phentermine.hem.nu phentermine prescription
http://buy-phentermine.hem.nu what is phentermine
http://buy-phentermine.hem.nu free phentermine
city dragonmoon hentai city dragonmoon hentai [url=http://hhent.com/index88.html]city dragonmoon hentai[/url] city dragonmoon hentai
This a good link's !
[i]Posted by Admin[/i]
apache hentai index jpg port apache hentai index jpg port apache hentai index jpg port apache hentai index jpg port
This a good link's !
Posted by Admin
hentai bdsm cages
hentai bdsm citizen cane
hentai bdsm ecard
hentai bdsm hot wax
hentai morgan webb bdsm
hentai bdsm chat personal ads dating
hentai bdsm toy
hentai dungeon whipped bdsm
hentai free bdsm hentai video
hentai young bbs
hentai vagina tgp
hentai naturist bbs
porno hentai
bbs hentai
pre teen hentais
free bbs hentais
incest art
teen incest
3d incest art
incest mom and son
Auto show
Detroit Auto_Show
Car Insurance Agent
Car Insuranc _Agent
Great Drives
In Gear
Car New Models
Racing
CONVERTIBLES
COUPES
MINIVANS
PICKUPS
SEDANS
SUVs
WAGONS HATCHBACKS
Video Galleries
http://www.watiti.com
Hi,
Join me and my circle of friends at http://www.watiti.com, an online social networking community that connects people from all over the world.
Meet new people, share photos, create or attend events, post free classifieds, send free e-cards, upload music, read blogs, upload videos, be part of a club, chat rooms, forum and much more!
See you around! Bring all your friends too!
http://www.watiti.com
lolita chin
lolitas 13
lolitas kid
free anal sex
lolita picture
lolita suck
lolita cp terra loltobbs ftp lol
lolita vip lolitas virgins bbs
lolita lolly fuck movie children
lolita chin
lolitas 13
lolitas kid
free anal sex
lolita picture
lolita suck
lolita cp terra loltobbs ftp lol
lolita vip lolitas virgins bbs
lolita lolly fuck movie children
preteen
free bbs
little angels
porn gallery
free movie sex
hard sex video
young breasts Asian
porn lolita bbs
sex nymphet
image madonna sex hent
bbs lolita
asian bbs preteen
hentai free xxx password
hentai hole shemale
hentai wallpaper xxx
bbs child models
bbs child
bbs lolita smuggler
bbs posting prelolitas
iboard lolita bbs
nymphet links
pedo incest
sex pictures
pedoworld
britney spears sucks dick
Asian School Girls
asian bestiality
viagra
She pulls away from him and hops up onto the edge of the hot tub, staring at him, hoping he will take the initiative.
She puts her hand slowly down her bikini to caress her wet pussy. Casey moves closer to her as she sticks her finger further into her pussy.
Before his bbs preteen link can touch her body, she pulls her soaked finger out, traces it on his bbs loli sunbbs, and slowly licks his bbc pictures lolitas clean.
He moves his head down her body, kissing her skin on his way. When he reaches her bikini,
he unties each side with his teeth and throws that piece in the hot tub as well. As he moves further down still, he kisses her stomach,
traveling down to her smooth pussy child sex slave industry. He starts by lightly kissing on the outside, all around, then penetrates her deep purple with his tongue.. slowly.
Moving in closer, he surrounds her clit with his dark russian lolita and sucks gently. With his free nymphet lolita around and his tongue circling her clit,
he slides a finger inside, fucking her faster and faster. He moves up and replaces his finger with his dick,
keeping up with the pace of her heartbeat felt through their chests.
They fuck so fast and hard that she is left with bruises and abrasions on her skin from the concrete that aren't found until the next morning.
"Damn, baby, I can't tell if I had a good time or if you kicked my ass. Maybe it was both," she said.
Hello!
Nice site, keep up the good work .
http://buy-phentermine.hem.nu BUY PHENTERMINE
BUY PHENTERMINE
http://blogg.sol.no/buy-phentermine
BUY PHENTERMINE
http://lesbian-school.moviesparisexposed.info/ LESBIAN SCHOOL
http://hot-school-teacher-naked.moviesparisexposed.info/ HOT SCHOOL TEACHER NAKED
http://sex-personals.moviesparisexposed.info/ SEX PERSONALS
http://virgin-blowjob.moviesparisexposed.info/ VIRGIN BLOWJOB
http://rabbit-vibrator.moviesparisexposed.info/ RABBIT VIBRATOR
http://college-group-orgy.moviesparisexposed.info/ COLLEGE GROUP ORGY
http://horny-school-teachers.moviesparisexposed.info/ HORNY SCHOOL TEACHERS
http://video-strip-poker.moviesparisexposed.info/ VIDEO STRIP POKER
http://adult-incontinence-product.moviesparisexposed.info/ ADULT INCONTINENCE PRODUCT
http://gothic-blowjob.moviesparisexposed.info/ GOTHIC BLOWJOB
http://blowjob-cartoon.moviesparisexposed.info/ BLOWJOB CARTOON
http://school-naked.moviesparisexposed.info/ SCHOOL NAKED
http://college-with-big-tits.moviesparisexposed.info/ COLLEGE WITH BIG TITS
http://bikini-blowjob.moviesparisexposed.info/ BIKINI BLOWJOB
http://college-fuck-fest-clips.moviesparisexposed.info/ COLLEGE FUCK FEST CLIPS
http://teen-masturbation-education.moviesparisexposed.info/ TEEN MASTURBATION
http://after-school-sex.moviesparisexposed.info/ AFTER SCHOOL SEX
http://college-hotties.moviesparisexposed.info/ COLLEGE HOTTIES
buying generic cialis
My sister and I love each other, but we fight constantly. We're always saying something rude about one other's hair, clothes, whatever, it doesn't matter, we quarrel. It's getting to the point were free celebrity sex clip will put in ear plugs if he's home with us for too long.
The other night, we thought Daddy might turn us over on his knee like he did when we were younger. We were in the bathroom, standing side by side. I looked over and up at my sister; I hated the fact that she was taller than me. She stands five foot seven inches tall, and I a mere five foot even. I think I also resented the fact that she was older than me. We're two years apart, she's 21 and I'm 19. We both have red hair, blue eyes, and freckles, some people have mistaken us for twins, but we're a year apart. Our bodies are different, she doesn't have much in the way of boobs, 36A, is all her cup size is, and I tease her about it all the time. Me, my boobs are a 36D. She doesn't have much in the way of hips either, very narrow she is, and I tell her she looks like a boy, which pisses her off. I got the better body entirely, I have a very shapely figure, and no one could ever mistake me for a boy. I was telling her that she needed to change her outfit, or buy clothes that fit her better. All her clothes drape o
ff of her like potato sacks; she was yelling at me, telling me that I dressed like a slut and I should be more conservative, when free childporn gallery burst through the door.
"That's enough! I want to hear no more from either one of you! You are driving me insane! You two are too old for this!"
My sister's first reaction is to get defensive and I let her go first.
"Dad, she started it!"
I looked up at Daddy sheepishly.
"No I didn't Daddy. I was just being honest. I can't help it if she can't stand to hear some criticism."
Daddy looked down at me. He knew what I was doing, but he always sided with me.
"You aren't dressed very well at all, free cross stitch patterns."
"You always side with her!"
She turned and gave me a mean look and I stuck my tongue out at her.
"Jessica! That's enough from you too."
I put my eyes down and nodded my head.
"Sorry Daddy I won't do it again."
My sister humphed my way and I moved past her. I stood on my tiptoes and kissed Daddy's cheek. "Sorry to make you angry Daddy."
He patted me on the head and smiled down.
"It's okay Darling. I just wish you two girls would get along."
"I'll try real hard Daddy."
I gave him another kiss, and as I got back behind him I stuck my tongue out at my sister again.
"Daddy! Look! Look what she's doing!"
Daddy didn't turn around.
"That's enough free digimon hentai pic! Get on out of here and go to bed!"
The bickering continued of course, until there was a break when Eliza was out with her boyfriend. I was in my room, reading and listen to music, actually enjoying the fact that she wasn't at home. I really hated fighting with her, but I couldn't ever stop myself from doing it. I heard the front door close and Eliza run up the stairs. I also heard Daddy yelling.
"Eliza, is everything alright?"
"Fine, Daddy, everything's fine!"
From the tone of her voice I knew she was okay. So, I went back to reading. I only got a few lines into the book when my door burst open and in came Eliza looking all flushed and fluttered.
"What's wrong? What happened?"
I fought with my sister a lot but I felt protective over her as well.
"Nothing. Well, okay something happened, but it wasn't wrong."
"What? You lost me somewhere in there."
"Oh Jess, it was fuckin' great!"
My eyes widened, my sister doesn't speak like that.
"Okay, what was it? C'mon you gotta tell me!"
"I did it."
I watched Eliza go to the door, check the hall, and then close the door completely.
"You did what?"
"You know!"
"No, I don't. What did you do?"
"Don't make me mad! Not tonight!"
"I'm not trying to make you mad; I don't know what the hell it is you're talking about."
"I had sex."
"Oh, that it?"
"What do you mean, is that it?"
"Well, by the way you came in here I thought maybe you'd had the shit fucked outta ya or something. Just having sex isn't anything special."
"You've had sex before?"
In its North American auto show premiere, Ferrari unveils the stunning Los Angeles Auto Show 599 GTB Fiorano at the 2006 Los Angeles Auto Show.The Los Angeles Auto Show 599 GTB Fiorano completes a range entirely overhauled in a little over two years.
"During the development of the Los Angeles Auto Show 599 GTB Fiorano we dedicated a great deal of attention to the North American market and especially to California where Ferrari has a high concentration of passionate clients," said Amedeo Felisa, General Manager of Ferrari S.p.A. "The V12 mid-front engine Los Angeles Auto Show 599 GTB Fiorano represents the best of Ferrari's current production. It is the highest performance production series Ferrari ever.
At the same time it provides unmatched comfort and driving pleasure," continued Mr Felisa. 2006 has been a significant year for Ferrari in terms of company performance, continuing the positive trend of 2005.In the first half of 2006, the company recorded revenues of euro; 706 million, a 16.7% increase on the same period last year.
More view here :
Auto Show
AutoSport
Buy car
Car Dealers
Car classification
Car Finance
Car Law
car loan
Car New Models
Car Parts
Car Problems
Car Reviews
Concept Cars
Formula1
Great Drives
In Gear
New cars
Road Tests
Sport Car
Truck Car
Used Cars
Vehicles
Video Galleries
THE MYSPACE WORLD
When a car load goes wrong more often then not it happens when the
Finance and Insurance manager prepares a contract for your. Many savings simple
evaporate in that room. Here is the list of things that usually go wrong ...
car loan
Post a Comment