Programmatic Access to SP Attributes

Alexander F. French Alexander.F.French at dartmouth.edu
Mon Jan 29 16:29:56 EST 2018


The NativeSPAttributeAccess example for ASP.NET is little misleading, having recently figured this out myself with the help of an older mailing list response.

In .NET your attributes will be available as Server Variables:
	Request.ServerVariables.GetValues("HTTP_BLAH");

Attributes will *not* be available in the Request Headers:
	//bad
	Request.Headers.GetValues("HTTP_BLAH");	// won't exist
	//bad
	//you will find
	Request.Headers.GetValues("BLAH");	//don't use this!  It's coming from the user's browser and shouldn't be trusted!
	//bad

Thanks,
Alex French

From: users [mailto:users-bounces at shibboleth.net] On Behalf Of Klingenstein, Nate
Sent: Monday, January 29, 2018 4:16 PM
To: Shib Users <users at shibboleth.net>
Subject: RE: Programmatic Access to SP Attributes

Chanda,

It depends on your hosting environment and the language, but generally, you find them as CGI variables as those are presented in that language.

https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.shibboleth.net%2Fconfluence%2Fdisplay%2FSHIB2%2FNativeSPAttributeAccess&data=02%7C01%7CAlexander.F.French%40dartmouth.edu%7C0d52c982734f426980b308d5675d7b66%7C995b093648d640e5a31ebf689ec9446f%7C0%7C1%7C636528573560095679&sdata=BQCQDQ87EEcICbjWfrcqC5dL0pmoTSpNkhNMmbm3Qyo%3D&reserved=0

If you’re having trouble, maybe the UK Federation help desk would be available.

Thanks,
Nate.

From: users [mailto:users-bounces at shibboleth.net] On Behalf Of Chanda Banda
Sent: Monday, January 29, 2018 11:05 AM
To: Shib Users <mailto:users at shibboleth.net>
Subject: Programmatic Access to SP Attributes


Hi,
I have successfully connected to the UK federation test IDP and I am getting attributes like
affiliation, entitlement back when I look inside Shibboleth.sso/Session.

My question is how can I get these attributes programmatically in my VB, C# or PHP programs?

Thank you.



More information about the users mailing list