mirror of
https://github.com/friendica/friendica
synced 2024-12-30 18:16:28 +01:00
auth manager update, increased verbosity on salmon logs
This commit is contained in:
parent
7be66b1d91
commit
4c5f3fbf79
3 changed files with 31 additions and 5 deletions
|
@ -30,6 +30,7 @@ $a->init_pagehead();
|
||||||
|
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
|
// header('Link: <' . $a->get_baseurl() . '/amcd>; rel="acct-mgmt";');
|
||||||
|
|
||||||
if((x($_SESSION,'authenticated')) || (x($_POST,'auth-params')) || ($a->module === 'login'))
|
if((x($_SESSION,'authenticated')) || (x($_POST,'auth-params')) || ($a->module === 'login'))
|
||||||
require("auth.php");
|
require("auth.php");
|
||||||
|
|
31
mod/amcd.php
31
mod/amcd.php
|
@ -1,10 +1,15 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function amcd_content(&$a) {
|
function amcd_content(&$a) {
|
||||||
header("Content-type: text/json");
|
//header("Content-type: text/json");
|
||||||
echo <<< EOT
|
echo <<< EOT
|
||||||
{
|
{
|
||||||
"methods": {
|
"version":1,
|
||||||
|
"sessionstatus":{
|
||||||
|
"method":"GET",
|
||||||
|
"path":"/session"
|
||||||
|
},
|
||||||
|
"auth-methods": {
|
||||||
"username-password-form": {
|
"username-password-form": {
|
||||||
"connect": {
|
"connect": {
|
||||||
"method":"POST",
|
"method":"POST",
|
||||||
|
@ -12,11 +17,29 @@ echo <<< EOT
|
||||||
"params": {
|
"params": {
|
||||||
"username":"login-name",
|
"username":"login-name",
|
||||||
"password":"password"
|
"password":"password"
|
||||||
}
|
},
|
||||||
|
"onsuccess": { "action":"reload" }
|
||||||
},
|
},
|
||||||
"disconnect": {
|
"disconnect": {
|
||||||
"method":"GET",
|
"method":"GET",
|
||||||
"path":"/logout"
|
"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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,8 +158,10 @@ function salmon_post(&$a) {
|
||||||
|
|
||||||
$verify = $rsa->verify($signed_data,$signature);
|
$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);
|
$verify = $rsa->verify($stnet_signed_data,$signature);
|
||||||
|
}
|
||||||
|
|
||||||
if(! $verify) {
|
if(! $verify) {
|
||||||
logger('mod-salmon: Message did not verify. Discarding.');
|
logger('mod-salmon: Message did not verify. Discarding.');
|
||||||
|
|
Loading…
Reference in a new issue