Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Kevin Cooper
Kevin Cooper
21,295 Points

Passing WordPress credentials to 3rd party site.

We need to pass the WP username password or a some sort of token to a 3rd party site that allows for login by-pass. Their documentation suggest a hidden form. See code example below. Sounds easy but I"m not sure exactly how to go about it from the WP end...specifically writing the code that will pass the username/password through the form. Any ideas?

3rd party documentation code:

Sample Page with a link (uses a hidden form to submit)

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>Digital StoreFront</title>

<script language="javascript" type="text/javascript">

function Login()

{

document.getElementById("Form1").submit();

}

</script>

</head>

<body>

<a href="javascript:Login()">LoginByPass</a>

<form id="Form1" action="http://dsfserver/DSF/signin.aspx?SITEGUID=c9c70a5c-95ef-40c9-b5b5-5b2c891d3d84" method="post">

<input type="text" name="token" id="token" value="LOGIN_BYPASS_USER_NAME" />

<input type="hidden" name="pwd" id="pwd" value="LOGIN_BYPASS_PWD" />

<!--  Example using blank password below (value="" when not sending password)

<input type="text" name="pwd" id="pwd" value=" " />

</form>

</body>

</html>

End 3rd party documentation code.