Oauth が情報を取得する方法であると仮定すると、Linked in プロファイルを持つ人が新しい ASP MVC4 Simple メンバーシップを使用してサイトにアカウントを作成できるようにするにはどうすればよいでしょうか。
1 に答える
1
http://developer.linkedin.com/documents/sign-linkedin
これは、認証と、リンクされたアカウントの詳細を使用した登録に関する基本的な考え方です。
<script type="text/javascript" src="http://platform.linkedin.com/in.js">
api_key: YOUR_API_KEY_GOES_HERE
authorize: true
</script>
<script type="IN/Login">
<form action="/register.html">
<p>Your Name: <input type="text" name="name" value="<?js= firstName ?> <?js= lastName ?>" /></p>
<p>Your Password: <input type="password" name="password" /></p>
<input type="hidden" name="linkedin-id" value="<?js= id ?>" />
<input type="submit" name="submit" value="Sign Up"/>
</script>
<script type="text/javascript">
function onLinkedInAuth() {
IN.API.Profile("me").result(function(me){
$.ajax({
type: 'POST',
url: '/Account/Login', //Register as linkedin
dataType: "json",
contentType: "application/json; charset=utf-8",
data: "{'Id': '" + me.values[0].id + "'}",
success: function (data) {
alert(data);
});
});
}
</script>
于 2013-01-01T22:26:36.397 に答える