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 7977075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:05:25+00:00 2026-06-04T09:05:25+00:00

I’m working on a scenario that runs like this: user click a link in

  • 0

I’m working on a scenario that runs like this: user click a link in a SAP site that takes him/her to a SharePoint site. To accomplish single sign-on, an http module takes a SAP cookie, gets a username and logs user into SharePoint.

When implemented on SP 2007, it used to work: simply calling SetAuthCookie(username) did the work, user got to the SharePoint 2007 site and everything worked as expected.

When on a SharePoint 2010 claims web app, it stopped working. That’s pretty much expected, per this great article from Steve Peschka. So I went ahead and started replacing the SetAuthCookie() code, but I’m facing two issues

Here’s my custom sign in code. Is there any equivalent to SetAuthCookie() that doesn’t need a password? (nevermind hard-coded url’s and pwd’s… just a prototype)

private SPIisSettings IisSettings
{
    get
    {
        SPWebApplication webApp = SPWebApplication.Lookup(new Uri("http://virtualcasa1/sites/blank2"));//XXX
        SPIisSettings settings = webApp.IisSettings[SPUrlZone.Default];
        return settings;
    }
}

private SecurityToken GetSecurityToken()
{
    SecurityToken token = null;
    SPIisSettings iisSettings = IisSettings;
    Uri appliesTo = new Uri("http://virtualcasa1");//XXX

    SPFormsAuthenticationProvider authProvider = iisSettings.FormsClaimsAuthenticationProvider;
    token = SPSecurityContext.SecurityTokenForFormsAuthentication(appliesTo, authProvider.MembershipProvider, authProvider.RoleProvider, "userfba", "pa55word");//XXX
    return token;
}

private void SignIn()
{
    SecurityToken token = null;

    if ((token = GetSecurityToken()) != null)
    {
        SPFederationAuthenticationModule fam = SPFederationAuthenticationModule.Current;
        HttpContext c = HttpContext.Current;
        fam.SetPrincipalAndWriteSessionToken(token);
        c.Response.Redirect("/sites/blank2");//XXX
    }
}

void OnAuthenticateRequest(object sender, EventArgs e)
{
    HttpContext c = HttpContext.Current;
    if (c.Request.Url.ToString().ToLowerInvariant().Contains("/authenticate.aspx"))
    {
        SignIn();
    }

Thanks much!

  • 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-04T09:05:26+00:00Added an answer on June 4, 2026 at 9:05 am

    Finally was able to answer my own question (hate to answer myself, but sometimes that’s the way it works…), here are the details. Hope it helps someone, somewhere.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So here's the scenario. I've got a script that runs some tests. I need
Let's me show first the scenario that is working: I have a HandlerAttribute that
the working scenario on a web bases app like a forum, the users can
I am working on prolog and faced this scenario - In my query, I
I have this massive nested loop scenario that is calling the DB and making
Scenario 1 (That Works) This is a POC i created. I have a script
I'm working on a web site which contains sections that need to be secured
I'm working on a web application that runs with ASP.Net 3.5 Somewhere in the
Here's a scenario that I am working on : Right now we have a
Scenario : I am working on LOB application, as in silverlight every call to

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.