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

Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
5,854 questions
Active Directory Federation Services
Active Directory Federation Services
An Active Directory technology that provides single-sign-on functionality by securely sharing digital identity and entitlement rights across security and enterprise boundaries.
1,189 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,245 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Pierre Audonnet - MSFT 10,166 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