]> git.mxchange.org Git - friendica.git/commitdiff
auth manager update, increased verbosity on salmon logs
authorFriendika <info@friendika.com>
Thu, 11 Nov 2010 22:53:39 +0000 (14:53 -0800)
committerFriendika <info@friendika.com>
Thu, 11 Nov 2010 22:53:39 +0000 (14:53 -0800)
index.php
mod/amcd.php
mod/salmon.php

index abb528f9517aa4dc491a4e96c4fc53d187ca2379..91b864df81357e3ecb66e99a9441b4efc7a761e9 100644 (file)
--- a/index.php
+++ b/index.php
@@ -30,6 +30,7 @@ $a->init_pagehead();
 
 session_start();
 
+// header('Link: <' . $a->get_baseurl() . '/amcd>; rel="acct-mgmt";');
 
 if((x($_SESSION,'authenticated')) || (x($_POST,'auth-params')) || ($a->module === 'login'))
        require("auth.php");
index 01c6b92da540049d1b77efa176faf3e2803cc0b6..a2a1327e6df8b47c5452eb2fe0e1780294b26988 100644 (file)
@@ -1,10 +1,15 @@
 <?php
 
 function amcd_content(&$a) {
-header("Content-type: text/json");
+//header("Content-type: text/json");
 echo <<< EOT
 {
-  "methods": {
+  "version":1,
+  "sessionstatus":{
+    "method":"GET",
+    "path":"/session"
+  },
+  "auth-methods": {
     "username-password-form": {
       "connect": {
         "method":"POST",
@@ -12,11 +17,29 @@ echo <<< EOT
         "params": {
           "username":"login-name",
           "password":"password"
-        }
+        },
+        "onsuccess": { "action":"reload" }
+      },
+      "disconnect": {
+        "method":"GET",
+        "path":"\/logout"
+      }
+    }
+  }
+  "methods": {
+    "username-password-form": {
+      "connect": {
+        "method":"POST",
+        "path":"\/login",
+        "params": {
+          "username":"login-name",
+          "password":"password"
+        },
+        "onsuccess": { "action":"reload" }
       },
       "disconnect": {
         "method":"GET",
-        "path":"/logout"
+        "path":"\/logout"
       }
     }
   }
index 3a18f35f09bf696c593b1205ef02b31330ee1b7d..3c62a6d8c556bb6eff1676e8987ad601fd69b567 100644 (file)
@@ -158,8 +158,10 @@ function salmon_post(&$a) {
 
     $verify = $rsa->verify($signed_data,$signature);
 
-       if(! $verify)
+       if(! $verify) {
+               logger('mod-salmon: message did not verify using protocol. Trying statusnet hack.');
            $verify = $rsa->verify($stnet_signed_data,$signature);
+    }
 
        if(! $verify) {
                logger('mod-salmon: Message did not verify. Discarding.');