source: sandbox/2.4-expresso-api/prototype/library/oauth2/server/examples/mongo/addclient.php @ 5888

Revision 5888, 897 bytes checked in by cristiano, 12 years ago (diff)

Ticket #2598 - implementação base REST + oauth

  • Property svn:executable set to *
Line 
1<?php
2
3/**
4 * @file
5 * Sample client add script.
6 *
7 * Obviously not production-ready code, just simple and to the point.
8 */
9
10require "lib/MongoOAuth2.php";
11
12if ($_POST && isset($_POST["client_id"]) && isset($_POST["client_secret"]) && isset($_POST["redirect_uri"])) {
13        $oauth = new MongoOAuth2();
14        $oauth->addClient($_POST["client_id"], $_POST["client_secret"], $_POST["redirect_uri"]);
15}
16
17?>
18
19<html>
20<head>
21Add Client
22</head>
23<body>
24<form method="post" action="addclient.php">
25<p><label for="client_id">Client ID:</label> <input type="text"
26        name="client_id" id="client_id" /></p>
27<p><label for="client_secret">Client Secret (password/key):</label> <input
28        type="text" name="client_secret" id="client_secret" /></p>
29<p><label for="redirect_uri">Redirect URI:</label> <input type="text"
30        name="redirect_uri" id="redirect_uri" /></p>
31<input type="submit" value="Submit" /></form>
32</body>
33</html>
Note: See TracBrowser for help on using the repository browser.