Read ADFS Claims in .net framework web forms application

Roman Gelfand 21 Reputation points
2022-04-14T04:49:23.053+00:00

I have successfully setup ad fs to redirect to .net framework web forms site upon successful login. I have defined claims for this relying part trust. How do I retrieve those claims in redirect page code behind?

Thanks in advance

Windows for business Windows Client for IT Pros Directory services Active Directory
Microsoft Security Active Directory Federation Services
Developer technologies C#
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Pierre Audonnet - MSFT 10,191 Reputation points Microsoft Employee
    2022-04-14T21:31:54.087+00:00

    It depends what you use on your application. There are examples in the public documentation: https://learn.microsoft.com/en-us/windows-server/identity/ad-fs/development/ad-fs-openid-connect-oauth-concepts

    0 comments No comments

  2. Roman Gelfand 21 Reputation points
    2022-04-21T01:46:25.58+00:00

    Thanks for your help.

    Actually, I am looking for a more detailed exampled.

    To elaborate what I am looking for...

    I am attempting to conver an exisiting web forms application to use ad fs.

    I have successfully setup ad fs to redirect to .net framework web forms site upon successful login. I have defined claims for this relying part trust. How do I retrieve those claims in redirect page code behind?

    I was able to retrieve the claims only when changing the authentication mode from anonymous to windows. However, this, also, produces authentication windows authentication popups. I don't want the popups. I suppose what I am looking for, let me know if it wrong, 1) upon successful ad fs login, I am redirected to web forms application signin page which doesn't prompt user with login since it receives user identity and other claims from ad fs. 2) Retrieve claims and lookup permissions on backend db based on user identity and claims. 3) Create and maintain session. Step 2 and 3 are done by the web forms application currently. So, I am looking to retrieve claims in 2).

    Thanks again

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.