title: How to extract application return URL and other custom parameters in AD FS 2.0 claim rules?
body: <p>This is probably a very basic question about AD FS 2.0 claim rule design that I haven't found an answer to (newbie). I'm probably missing something very basic, but here goes. </p>
  
  <p>I'm deploying a federation within a company. The company users will be able to browse to a web application A, B, C etc. Each app will have their own subdomain URL, e.g. app-a.company.org, app-b.company.org, etc. When the application redirects to its trusted STS landing page I want the return URL to be passed to the STS. In the STS claim rules I want to extract that return URL and perform a database lookup, e.g. for the current user and the application with URL "app-a.company.org" I want all roles that the user has in that application (e.g. admin, superuser, purchaser, whatever).</p>
  
  <p>My questions are: </p>
  
  <ol>
  <li>How do I pass along the return URL to the STS?</li>
  <li>How do I write the claim rule? (I know how to make the database lookup and issue the results, but I don't know how to retrieve the return URL or any other custom parameter for that matter in a claim rule).</li>
  </ol>
  
  <p>Cheers,</p>
  
  <p>Linus</p>