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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:13:23+00:00 2026-05-14T00:13:23+00:00

I host and intranet and manager several Single Sign Ons for outside websites. We

  • 0

I host and intranet and manager several Single Sign Ons for outside websites. We have always done this through some sort of hidden form.

Example

<form method="post" action="example.php">
<input type="hidden" value="user" name="user" />  
<input type="hidden" value="password" name="password" />
</form>

We can then have a javascript event submit the hidden form behind the scene and log in the user.

However, a more sophisticated user, who is already authenticated into our site, could view the source and view the user name and password.

I would prefer to have the information posted from a PHP script to seamlessly log them into the external site.

I have done a lot of research on the web and have come up with a few consistent lines of code that people implement that don’t seem to work.

They usually are similar to the code below:

 $ch = curl_init($POSTURL);
 curl_setopt($ch, CURLOPT_POST      ,1);
 curl_setopt($ch, CURLOPT_POSTFIELDS,POSTVARS);
 curl_setopt($ch, CURLOPT_FOLLOWLOCATION  ,1);
 curl_setopt($ch, CURLOPT_HEADER      ,0);  // DO NOT RETURN HTTP HEADERS
 curl_setopt($ch, CURLOPT_RETURNTRANSFER  ,1);  // RETURN THE CONTENTS OF THE CALL
 $Rec_Data = curl_exec($ch);
 curl_close($ch);

However, I the authentication does not seem to work . If I try to print what is returned by curl_exec, I don’t have any success. I also am not sure if this would even be the right way to go about it.

I get the following error from my code:

Curl error: error setting certificate verify locations: CAfile: /etc/ssl/certs
/ca-certificates.crt CApath: none

I don’t want to keep the users inside our site, I just want to launch the other site after authenticating them. If this works in a standard HTML post, I should be able to recreate this ability using server side code. Right?

On a side note, I have done something like this in my former life with Coldfusion. It was much much easier. Surely PHP and all its users have come up with something!

  • 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-05-14T00:13:23+00:00Added an answer on May 14, 2026 at 12:13 am

    You won’t be able to do this with cURL or any other similar methods.

    The code example you’ve posted above runs on the server, not on the client. Therefore you are authenticating the server to the third-party website and not the client. Since you cannot send a cookie as another domain to the client, signing on server side is pretty useless (well, unless you plan to proxy the whole site, which really isn’t a solution).

    When you sit back and think about it, who needs to be authenticated here? The client or the server? The client does.

    You need to do your work client-side in order to login the CLIENT on the third-party website. Your hidden form approach works well, but isn’t very secure.

    You could also encrypt the values in the HTML and decrypt it client-side using JavaScript onSubmit, but that would be security by obscurity (your decrypt key and algorithm will be available to any malicious user wanting to get the values).

    The best (well, security-wise) would be to use either Flash or Java or an ActiveX control to send the request on the third-party website. That way, your login credentials are locked into a format that really isn’t easy to extract (still possible, but beyond the reach of most users), and it is executed client-side.

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

Sidebar

Related Questions

I have to create WCF servers farm (several workstations in Intranet environment that host
I host a project on github.com. My project have some git submodules. One can
I have an intranet app that needs to know where to print some labels.
My team has a new Asp.net MVC intranet app. I have been doing some
I have a simple HTML page that rotates through several status pages that I
I write and host web applications on Windows servers for intranet usage. My server
I'm making a really simple virtual host administrator in my office intranet (on a
my host (one.com) doesn´t support java webapps. But I have a java programm that
My host : 1and1.com My setup : I have my main domain and a
In our Intranet environment we have a decree that common assets (stylesheets, images, etc)

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.