Skip to content

authentication failed #87

@Taufiqueshaikh24

Description

@Taufiqueshaikh24

I am using pfsense version 2.7.0

My credentials.sample.ini
[PFFApmZct0c2GNW6AC5spIFs]
secret = hwcf7405cGl3WZmsUWwi1KohbI3XDHZZhhnEIXzXLOygsxK8n45ts7Owbex3
permit = alias_, config_, gateway_, rule_, send_, system_, function_*
comment = example key PFFApmZct0c2GNW6AC5spIFs - hardcoded to be inoperative

I am using typescript fauxapi-client

import {FauxApiClient, IFauxApiResponse} from 'faux-api-client';

const fauxApiClient = new FauxApiClient(
'192.168.0.100',
'PFFApmZct0c2GNW6AC5spIFs',
'hwcf7405cGl3WZmsUWwi1KohbI3XDHZZhhnEIXzXLOygsxK8n45ts7Owbex3'
);

fauxApiClient.getConfiguration()
.then((success: IFauxApiResponse) => {
console.log('#################################################');
console.log('# SUCCESS #');
console.log('#################################################');
console.log(JSON.stringify(success));
})
.catch((error: Error) => {
console.log('#################################################');
console.log('# ERROR #');
console.log('#################################################');
console.log(JSON.stringify(error));
});

Error : -

#################################################

ERROR

#################################################
{"name":"StatusCodeError","statusCode":401,"message":"401 - {"callid":"66382edddeb73","message":"authentication failed"}","error":{"callid":"66382edddeb73","message":"authentication failed"},"options":{"headers":{"Content-Type":"application/json","fauxapi-auth":"PFFApmZct0c2GNW6AC5spIFs:20240505Z201348:6dfd4502:7465c9d52c98ef93312b77893466c4d050fb8b35bb763750cc781481ac71bfb0"},"json":true,"rejectUnauthorized":false,"uri":"https://192.168.0.100/fauxapi/v1/?action=system_stats","method":"GET","simple":true,"resolveWithFullResponse":false,"transform2xxOnly":false},"response":{"statusCode":401,"body":{"callid":"66382edddeb73","message":"authentication failed"},"headers":{"server":"nginx","date":"Mon, 06 May 2024 01:14:05 GMT","content-type":"application/json","transfer-encoding":"chunked","connection":"close"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"192.168.0.100","port":443,"hostname":"192.168.0.100","hash":null,"search":"?action=system_stats","query":"action=system_stats","pathname":"/fauxapi/v1/","path":"/fauxapi/v1/?action=system_stats","href":"https://192.168.0.100/fauxapi/v1/?action=system_stats"},"method":"GET","headers":{"Content-Type":"application/json","fauxapi-auth":"PFFApmZct0c2GNW6AC5spIFs:20240505Z201348:6dfd4502:7465c9d52c98ef93312b77893466c4d050fb8b35bb763750cc781481ac71bfb0","accept":"application/json"}}}}
StatusCodeError: 401 - {"callid":"66382edddeb73","message":"authentication failed"}

credentials ini file
image
tsfile:-
image

Error:-
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions