Directory Programming .NET

Active Directory and ADAM programming support for .NET developers
Welcome to Directory Programming .NET Sign in | Join | Help
in Search

ADFS and Cookies

Last post 06-13-2008, 10:30 PM by joe. 12 replies.
Sort Posts: Previous Next
  •  06-02-2008, 3:26 PM 3768

    ADFS and Cookies

    ·         Realm Selection, can it be cookie-less?

    ·         Does ADFS required cookies at all, is there another way to perform the ADFS functions?

    These questions were posed by the client. 

     

    It is my understanding that ADFS required cookies, but is this a non-negotiable item with ADFS?

     

    Does Open ID use cookies?

  •  06-02-2008, 9:32 PM 3772 in reply to 3768

    Re: ADFS and Cookies

    ADFS requires cookies for sure, although not for realm selection.  The logon token itself is persisted between logons in a cookie.

    I don't know if OpenID requires cookies, although I imagine it does.  You'll likely lose some of your strong Windows integration like the NT token agent if you go in that direction though (and thus OWA). 

    You can override realm detection with query strings if you like.

    What is the big deal with cookies?  The logon cookie is a session cookie, so it won't be rejected by the browser.

  •  06-03-2008, 8:31 AM 3775 in reply to 3772

    Re: ADFS and Cookies

    The few topics I started were just in response to my con-call I had showing my lab setup to the client.  So I told them I'd pass along some questions.

    Even though some don't want cookies at all, it is nice to know that the browser won't reject them.  I tried it and it worked, although IE 7 allows you to block even session cookies as well.  You can't even have .NET session if you turn off session cookies anyway.

  •  06-04-2008, 9:24 AM 3789 in reply to 3772

    Re: ADFS and Cookies

    Joe, it is my understanding that cookie-less apps can exist in .NET.  However as I understand ADFS, you have to at least accept session cookies because these cookies persist the login credendials between resources.  .NET can have cookie-less because it is on the same web server and uses query-string/URL values to mimmick what the cookie does to store the session ID.  ADFS can't/isn't going to do that for security reasons I would think.

    Is my understanding correct?

  •  06-05-2008, 1:58 PM 3806 in reply to 3789

    Re: ADFS and Cookies

    That is basically right, yes.  For session state, all you need to do is round trip some sort of pointer back to the user's session state information, so that is doable in either a cookie or query string.  However, the ADFS logon token is the actual data and not a pointer to the data, so it is stored in a cookie.  It is actually too big to fit in a query string in many cases, so using a gigantic query string might not work.

    If you stored the data server side and just had the client maintain a pointer, you would need some sort of persistence mechanism like session state to store it, and that would require that the application support session state or something similar.  That would be a big demand on the underlying application since session state tends to kill scalability and makes scale out more complicated, so that would be a difficult thing to impose on applications in general.

  •  06-06-2008, 8:40 AM 3815 in reply to 3806

    Re: ADFS and Cookies

    By setting the token lifetime am I setting the timeout for the users login?  Is that what expires the ADFS session cookie?

  •  06-09-2008, 11:48 PM 3847 in reply to 3815

    Re: ADFS and Cookies

    Yes, for the most part.  Note that there are multiple different tokens involved, especially in a cross-org sign in, so you might not actually see an expiration event.  For example, if the app times out at 60 minutes but the cookie issued by the FS itself is good for 10 hours, then the FS will just issue the user a new app token good for 60 more minutes.

    The timestamp is actually in the cookie data though and does not work off of the expires field on the cookie itself.

  •  06-10-2008, 8:28 AM 3853 in reply to 3847

    Re: ADFS and Cookies

    Because the way ADFS works it sounds like the longest timeout wins, at least on the side that creates the login token.
  •  06-10-2008, 1:01 PM 3863 in reply to 3853

    Re: ADFS and Cookies

    That's basically my experience, yes. 
  •  06-12-2008, 9:34 AM 3886 in reply to 3863

    Re: ADFS and Cookies

    Here's another issue I notice.

    I have multiple partners that each have accounts and resources.

    I've noticed that when I login to different resources, it is possible to have multiple home realms selected.  Is this just because the realm cookie is specific to each FS-R?

  •  06-12-2008, 5:59 PM 3898 in reply to 3886

    Re: ADFS and Cookies

    The realm cookie IS specific to each FS-R.  If you look at the set-cookie header for the _LSRealm cookie, you will see that it contains no domain parameter so that means that the browser will only return it to the host that issued it.
  •  06-13-2008, 8:16 AM 3914 in reply to 3898

    Re: ADFS and Cookies

    That makes sense, I think it will just be confusing for users/organizations to understand why it has to be like that.

    Would it be possible to allow the user to select their realm once for all resource groups, or would that cause other problems?

  •  06-13-2008, 10:30 PM 3932 in reply to 3914

    Re: ADFS and Cookies

    I've heard of organizations setting realm cookies via group policy, but I'm not a GPO guy and don't know how to do this.

    Otherwise, there is no way to do this that I know of.  You can use the whr query string to override HRD behavior, but that isn't always practical since you can't always control the URL the user will use.

View as RSS news feed in XML