Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8246639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:34:21+00:00 2026-06-07T22:34:21+00:00

I would really appreciate some help in understanding how Claims are used in a

  • 0

I would really appreciate some help in understanding how Claims are used in a local desktop app. Here’s the scenario: I want to display a tab f.e. depending on wether the user has a claim like “AnalysisAllowed:true”. So I want to fetch the claims at app start and bind against them later.

All samples are talking about how to make WCF use Authorization- and AuthenticationManagers to do claims-based calls to other WCF-Services but I just want to contact the sts (how do I do that? WCF-Fed Binding?) and than cache the stuff to use it. No other Service calls… 🙂

Thanks a lot!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T22:34:23+00:00Added an answer on June 7, 2026 at 10:34 pm

    In the default configuration (client & STS), the tokens you get will be encrypted (apart from being signed). If you own the whole thing (client and services), then you can tweak some knobs so that the token can be “readable” from the client (hence, not encrypted).

    Here you have some code that will give you an unencrypted SAML token from ADFS (the key thing is to ask for a “bearer” token and configure ADFS relying party without an encryption certificate).

    private static SecurityToken GetSamlToken(string realm, string stsEndpoint, ClientCredentials clientCredentials)
    {
        using (var factory = new WSTrustChannelFactory(
            new UserNameWSTrustBinding(SecurityMode.TransportWithMessageCredential), 
            new EndpointAddress(new Uri(stsEndpoint))))
        {
            factory.Credentials.UserName.UserName = clientCredentials.UserName.UserName;
            factory.Credentials.UserName.Password = clientCredentials.UserName.Password;
            factory.Credentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None;
            factory.TrustVersion = TrustVersion.WSTrust13;
    
            WSTrustChannel channel = null;
    
            try
            {
                var rst = new RequestSecurityToken
                              {
                                  RequestType = WSTrust13Constants.RequestTypes.Issue, 
                                  AppliesTo = new EndpointAddress(realm), 
                                  KeyType = KeyTypes.Bearer, 
                              };
    
                channel = (WSTrustChannel)factory.CreateChannel();
    
                return channel.Issue(rst);
            }
            finally
            {
                if (channel != null)
                {
                    channel.Abort();
                }
    
                factory.Abort();
            }
        } 
    

    Once you have the token you can use LINQ to XML or WIF to get the ClaimsIdentity out of the SecurityToken. Make sure you are using SSL between the client and the STS and the services.

    A second option you have is to rely on the services to return the list of claims. It’s one more request, but you will do it at the same time the users logs in and then cache those claims until the token expires.

    public IEnumerable<Claim> GetUserClaims() {
          // get Thread.CurrentPricinpal IClaimsIdentity and grab the claims
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to Ruby and would really appreciate some help understanding what is
Would really appreciate some help with this. I have an app which consists of
I'm new to Android developing and I would really appreciate some help here. I'm
I would really appreciate it if some of you could help optimize my tables,
I would really appreciate any jquery expert help as a method I've used previously,
I am struggling to solve a problem and would really appreciate some help. public
Would really appreciate some help with a search angine I'm trying to make for
I would really appreciate some help with my problem: I have 2 MySQL tables,
I'm fairly new to SQL Server and would really appreciate some help with this.
I'm totally stumped on this error. Would really appreciate some help :). To reproduce

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.