Main Page and Authorize: Difference between pages

From SafeStamper API documentation
(Difference between pages)
Jump to navigation Jump to search
No edit summary
 
m (1 revision imported)
 
Line 1: Line 1:
<strong>MediaWiki has been installed.</strong>
This operation can be used instead of the web authorization page, if the application has access to the user's credentials.


Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User's Guide] for information on using the wiki software.
Usage of this operation is discouraged for security and privacy reasons, so that the application doesn't need to know the user's access credentials.  


== Getting started ==
It is preferred to redirect the user to '''<nowiki>https://web.safestamper.com/authorize/<AUTHKEY></nowiki>''',
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]
as explained in [[API Overview#User authorization|User authorization]]
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]
 
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]
This operation is only available for designated partners.
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]
 
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]
= URL =
<nowiki>https://www.safestamper.com/api/authorize</nowiki>
 
= Parameters =
* '''sharedkey''': Your API client shared key
* '''username''': Username or e-mail of Safe Stamper account to authorize
* '''password''': Password of Safe Stamper account
* '''signature''': Parameters signature, as explained in [[Signature parameter]]
 
 
= Returns =
 
A JSON object with the authorization key status, as returned by [[authstate]]:
 
* '''authkey''': Authkey value
* '''authorized''': true/false.
 
= HTTP Errors =
 
* '''403''' Forbidden: the sharedkey or signature are not valid
* '''401''' Unauthorized: the username or password are not valid
 
= Example =
 
REQUEST:
<pre>
https://www.safestamper.com/api/authorize
?sharedkey=axvmfqn8aex21mxhq5zsj7l482saxfu7j4hh
&username=apitest
&password=ddddd
&signature=686349c6cbb0fe9094ec26927f4e62306a0263ae
</pre>
 
RESPONSE (actual response has no line breaks or indentation):
<pre>
{
  "authkey":"0021d81c-e4a5-4869-8384-2fd70cdb58ec",
  "authorized":true,
  "availableCertificates":50,
  "availableNavigations":3,
  "userCode":"1612020000541",
  "userName":"Api User  Test"
}
</pre>

Latest revision as of 15:27, 17 October 2023

This operation can be used instead of the web authorization page, if the application has access to the user's credentials.

Usage of this operation is discouraged for security and privacy reasons, so that the application doesn't need to know the user's access credentials.

It is preferred to redirect the user to https://web.safestamper.com/authorize/<AUTHKEY>, as explained in User authorization

This operation is only available for designated partners.

URL

https://www.safestamper.com/api/authorize

Parameters

  • sharedkey: Your API client shared key
  • username: Username or e-mail of Safe Stamper account to authorize
  • password: Password of Safe Stamper account
  • signature: Parameters signature, as explained in Signature parameter


Returns

A JSON object with the authorization key status, as returned by authstate:

  • authkey: Authkey value
  • authorized: true/false.

HTTP Errors

  • 403 Forbidden: the sharedkey or signature are not valid
  • 401 Unauthorized: the username or password are not valid

Example

REQUEST:

https://www.safestamper.com/api/authorize
?sharedkey=axvmfqn8aex21mxhq5zsj7l482saxfu7j4hh
&username=apitest
&password=ddddd
&signature=686349c6cbb0fe9094ec26927f4e62306a0263ae

RESPONSE (actual response has no line breaks or indentation):

{
   "authkey":"0021d81c-e4a5-4869-8384-2fd70cdb58ec",
   "authorized":true,
   "availableCertificates":50,
   "availableNavigations":3,
   "userCode":"1612020000541",
   "userName":"Api User  Test"
}