Add KeyToken authorization

This commit is contained in:
2023-04-21 21:45:16 +02:00
parent 16f6ab4861
commit b1bd278f9b
49 changed files with 3109 additions and 1313 deletions

View File

@@ -23,7 +23,7 @@
<pre>
curl \
--data "user_id=${userid}" \
--data "user_key=${userkey}" \
--data "key=${key}" \
--data "title=${message_title}" \
--data "content=${message_body}" \
--data "priority=${0|1|2}" \
@@ -36,7 +36,7 @@ curl \
<pre>
curl \
--data "user_id={userid}" \
--data "user_key={userkey}" \
--data "key={key}" \
--data "title={message_title}" \
{{config|baseURL}}/</pre>

View File

@@ -26,11 +26,11 @@
</p>
<p>
To receive them you will need to install the <a href="https://play.google.com/store/apps/details?id=com.blackforestbytes.simplecloudnotifier">SimpleCloudNotifier</a> app from the play store.
When you open the app you can click on the account tab to see you unique <code>user_id</code> and <code>user_key</code>.
When you open the app you can click on the account tab to see you unique <code>user_id</code> and <code>key</code>.
These two values are used to identify and authenticate your device so that send messages can be routed to your phone.
</p>
<p>
You can at any time generate a new <code>user_key</code> in the app and invalidate the old one.
You can at any time generate a new <code>key</code> in the app and invalidate the old one.
</p>
<p>
There is also a <a href="/">web interface</a> for this API to manually send notifications to your phone or to test your setup.
@@ -52,7 +52,7 @@
All Parameters can either directly be submitted as URL parameters or they can be put into the POST body (either multipart/form-data or JSON).
</p>
<p>
You <i>need</i> to supply a valid <code>[user_id, user_key]</code> pair and a <code>title</code> for your message, all other parameter are optional.
You <i>need</i> to supply a valid <code>[user_id, key]</code> pair and a <code>title</code> for your message, all other parameter are optional.
</p>
</div>
@@ -90,7 +90,7 @@
</tr>
<tr>
<td data-label="Statuscode">401 (Unauthorized)</td>
<td data-label="Explanation">The user_id was not found or the user_key is wrong</td>
<td data-label="Explanation">The user_id was not found or the key is wrong</td>
</tr>
<tr>
<td data-label="Statuscode">403 (Forbidden)</td>
@@ -126,7 +126,7 @@
</p>
<pre>curl \
--data "user_id={userid}" \
--data "user_key={userkey}" \
--data "key={key}" \
--data "title={message_title}" \
--data "content={message_content}" \
{{config|baseURL}}/</pre>
@@ -144,7 +144,7 @@
</p>
<pre>curl \
--data "user_id={userid}" \
--data "user_key={userkey}" \
--data "key={key}" \
--data "title={message_title}" \
--data "priority={0|1|2}" \
{{config|baseURL}}/</pre>
@@ -159,7 +159,7 @@
</p>
<pre>curl \
--data "user_id={userid}" \
--data "user_key={userkey}" \
--data "key={key}" \
--data "title={message_title}" \
--data "channel={my_channel}" \
{{config|baseURL}}/</pre>
@@ -179,7 +179,7 @@
</p>
<pre>curl \
--data "user_id={userid}" \
--data "user_key={userkey}" \
--data "key={key}" \
--data "title={message_title}" \
--data "msg_id={message_id}" \
{{config|baseURL}}/</pre>
@@ -198,7 +198,7 @@
</p>
<pre>curl \
--data "user_id={userid}" \
--data "user_key={userkey}" \
--data "key={key}" \
--data "title={message_title}" \
--data "timestamp={unix_timestamp}" \
{{config|baseURL}}/</pre>

View File

@@ -23,7 +23,7 @@ function send()
let data = new FormData();
data.append('user_id', uid.value);
data.append('user_key', key.value);
data.append('key', key.value);
if (tit.value !== '') data.append('title', tit.value);
if (cnt.value !== '') data.append('content', cnt.value);
if (pio.value !== '') data.append('priority', pio.value);

View File

@@ -89,7 +89,7 @@ usage<span style="color: #f92672">()</span> <span style="color: #f92672">{</span
--output /dev/null <span style="color: #ae81ff">\</span>
--write-out <span style="color: #e6db74">&quot;%{http_code}&quot;</span> <span style="color: #ae81ff">\</span>
--data <span style="color: #e6db74">&quot;user_id=$user_id&quot;</span> <span style="color: #ae81ff">\</span>
--data <span style="color: #e6db74">&quot;user_key=$user_key&quot;</span> <span style="color: #ae81ff">\</span>
--data <span style="color: #e6db74">&quot;key=$key&quot;</span> <span style="color: #ae81ff">\</span>
--data <span style="color: #e6db74">&quot;title=$title&quot;</span> <span style="color: #ae81ff">\</span>
--data <span style="color: #e6db74">&quot;timestamp=$sendtime&quot;</span> <span style="color: #ae81ff">\</span>
--data <span style="color: #e6db74">&quot;content=$content&quot;</span> <span style="color: #ae81ff">\</span>

View File

@@ -26,7 +26,7 @@
<span style="color: #008800; font-style: italic"># INSERT YOUR DATA HERE #</span>
<span style="color: #008800; font-style: italic">################################################################################</span>
user_id=<span style="color: #0000FF">&quot;999&quot;</span>
user_key=<span style="color: #0000FF">&quot;??&quot;</span>
key=<span style="color: #0000FF">&quot;??&quot;</span>
<span style="color: #008800; font-style: italic">################################################################################</span>
usage() {
@@ -89,7 +89,7 @@ content=<span style="color: #0000FF">&quot;&quot;</span>
--output /dev/null <span style="color: #0000FF">\</span>
--write-out <span style="color: #0000FF">&quot;%{http_code}&quot;</span> <span style="color: #0000FF">\</span>
--data <span style="color: #0000FF">&quot;user_id=$user_id&quot;</span> <span style="color: #0000FF">\</span>
--data <span style="color: #0000FF">&quot;user_key=$user_key&quot;</span> <span style="color: #0000FF">\</span>
--data <span style="color: #0000FF">&quot;key=$key&quot;</span> <span style="color: #0000FF">\</span>
--data <span style="color: #0000FF">&quot;title=$title&quot;</span> <span style="color: #0000FF">\</span>
--data <span style="color: #0000FF">&quot;timestamp=$sendtime&quot;</span> <span style="color: #0000FF">\</span>
--data <span style="color: #0000FF">&quot;content=$content&quot;</span> <span style="color: #0000FF">\</span>