Comments (1)
Hi - sorry to hear you are having a hassle with this, I think the source of your trouble here is that you are not specifying the timestamp in UTC with the --utc flag in the date
command line, I suspect I need to document this better.
I'd encourage you to enable debug mode by adding &__debug=true
to the end of your URL, this way you get a lot more detail about why the auth request is failing. It's likely you also want to pipe the curl return data through jq
to pretty print the JSON response data so you can human-read it easier.
I note that you are asking a question about what a "nonce" value is. A nonce value is simply nonsense random data that exists so that no two auth tokens will be the same.
However, you can save yourself a lot of time by just looking at the supplied BASH library fauxapi_lib.sh - the bash function you are looking for is below.
fauxapi_auth() {
fauxapi_apikey=${1}
fauxapi_apisecret=${2}
fauxapi_timestamp=`date --utc +%Y%m%dZ%H%M%S`
fauxapi_nonce=`head -c 40 /dev/urandom | md5sum | head -c 8`
# NB:-
# auth = apikey:timestamp:nonce:HASH(apisecret:timestamp:nonce)
fauxapi_hash=`echo -n ${fauxapi_apisecret}${fauxapi_timestamp}${fauxapi_nonce} | sha256sum | cut -d' ' -f1`
fauxapi_auth=${fauxapi_apikey}:${fauxapi_timestamp}:${fauxapi_nonce}:${fauxapi_hash}
echo ${fauxapi_auth}
}
from pfsense_fauxapi.
Related Issues (20)
- Wake On LAN via fauxapi
- Allow UNIX timestamp auth HOT 1
- Kill states after enabling of rule HOT 1
- pfSense 2.4.4-p3 - URL table alias updating broken (simple fix) HOT 2
- Not executing commands until web browser refresh HOT 8
- Example to add new users and move to member groups HOT 1
- make firewall rule with python fauxapi HOT 2
- pfsense 2.5.x official repo? HOT 3
- Set timeout HOT 3
- fetch : bad request HOT 1
- Instruction Update HOT 2
- config_set does update but new Virtual IP is not added HOT 1
- apikey_value generation HOT 7
- Hash is marked as invalid unless lowercase
- Need to use GUI to save freeradius ?
- List of supported items for config_item_set
- Authentication failed, even though credentials were added HOT 1
- function_call: service_control_stop($name, $extras) not working
- authentication failed HOT 4
- cleanup_backupcache() seems to be missing in 24.03
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pfsense_fauxapi.