MyBB Community Forums

Full Version: consume asp.net web api throw mybb
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everybody
I have implemented website with ASP.NET MVC4 and WEB API
So
I want to integrate my login procedure to MYBB.

Scenario:
first User come to my website (ASP.NET) and create account
second he will be able login to MYBB forum throw created account on ASP.NET web site.

note: I created web service with asp.net mvc web api ,so I want that MYBB consume my api for authentication !

This is my university Project , please help me on this.
Well its more that you want to pass the login information to mybb, the simplest way to do all of that would be to insert the username and password and account information in to myBB

and then have your asp.net login information set the myBB cookies
(2012-10-26, 03:41 AM)Dannymh Wrote: [ -> ]Well its more that you want to pass the login information to mybb, the simplest way to do all of that would be to insert the username and password and account information in to myBB

and then have your asp.net login information set the myBB cookies

Yes that is a nice Idea,
unfortunately , I am not much familiar with php so, I appreciate if you tell me which file of mybb and the related part must be modified ?
code that must be used in mybb to consume my service is :

<?php
$data = array("UserName" => "test", "Password" => "123");
$data_string = json_encode($data);

$ch = curl_init('http://localhost:6236/api/values/post');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data_string))
);

$result = curl_exec($ch);

echo $result;
?>