Difference between revisions of "Protocols/WebAPI/Auth/Client/client2web"

From NINA Wiki
Jump to navigation Jump to search
m (AD moved page Protocols/WebAPI/Auth/client2web to Protocols/WebAPI/Auth/Client/client2web without leaving a redirect: Changed URL structure)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{Protocols/WebAPI}}
 
{{Protocols/WebAPI}}
  
This page is about the client2Web method for [[Protocols/WebAPI/Auth|WebAPI authentication]].
+
This page is about the client2Web method for [[Protocols/WebAPI/Auth/Client|WebAPI Client]] authentication.
  
If the client wants to establish a Web authenticated session for the currently logged in user, it has to send a login request to NINA Web Authentication System with the following parameters. The request has to be signed as specified below in the [[Protocols/WebAPI/Auth/Signing_Requests|appendix]] using the Session Key generated.
+
If the client wants to establish a Web authenticated session for the currently logged in user, it has to send a login request to NINA Web Authentication System with the following parameters. The request has to be signed as specified below in the [[Protocols/WebAPI/Auth/Client/Signing_Requests|appendix]] using the Session Key generated.
  
 
== Initial Request ==
 
== Initial Request ==
Line 25: Line 25:
 
*** Base64 encoded digital signature (HMAC-SHA256) of the request using the Session Key generated as below.
 
*** Base64 encoded digital signature (HMAC-SHA256) of the request using the Session Key generated as below.
 
**** Session Key = base64_encode[HMAC-SHA256(key, data)] where key is the user's password and data is the session secret obtained from clientLogin response.
 
**** Session Key = base64_encode[HMAC-SHA256(key, data)] where key is the user's password and data is the session secret obtained from clientLogin response.
*** Please refer to [[Protocols/WebAPI/Auth/Signing_Requests|Signing Requests]] for information about how to generate signature.
+
*** Please refer to [[Protocols/WebAPI/Auth/Client/Signing_Requests|Signing Requests]] for information about how to generate signature.
  
 
== Response Format ==
 
== Response Format ==
Upon successful validation of the request, user will be redirected to the destination URL. If no destination URL is provided, HTTP status codes will be returned as follows:
 
  
* 200 - Success; Establishes web authentication session for the user.
+
Upon successful validation of the request, user will be redirected to the destination Url. If no destination Url is provided, HTTP status codes will be returned as follows:
* 400 - Failure; Due to invalid/expired token or invalid sig_sha256 value.
+
 
 +
; 200 - Success
 +
: Establishes web authentication session for the user.
 +
; 400 - Failure
 +
: Due to invalid/expired token or invalid sig_sha256 value.
  
 
[[Category:Stub]]
 
[[Category:Stub]]
Line 37: Line 40:
 
[[Category:AIM]]
 
[[Category:AIM]]
 
[[Category:Protocols/WebAPI]]
 
[[Category:Protocols/WebAPI]]
 +
[[Category:Protocols/WebAPI/Auth]]
 +
[[Category:Protocols/WebAPI/Auth/Client]]
 
[[Category:Work_In_Progress]]
 
[[Category:Work_In_Progress]]

Latest revision as of 22:53, 25 March 2020

WebAPI Protocol
Basic
Introduction
Clients
Whimsicals
Host Interaction
Flow
Authentication
Client
WebApp
Other Services
Foodgroups

This page is about the client2Web method for WebAPI Client authentication.

If the client wants to establish a Web authenticated session for the currently logged in user, it has to send a login request to NINA Web Authentication System with the following parameters. The request has to be signed as specified below in the appendix using the Session Key generated.

Initial Request

  • URL
  • HTTP Method
    • GET or POST
  • Arguments
    • devId (required)
      • your developer Id required to access NINA APIs
    • entryType (required)
      • value as "client2Web"
    • ts (required)
      • current timestamp in seconds since epoch used to make sure the request cannot be replayed after a few mins
    • destUrl (optional)
      • the destination url to redirect to after establishing web authentication session
    • a (required)
      • the Authentication token returned by "clientLogin" method
    • sig_sha256 (required)
      • Base64 encoded digital signature (HMAC-SHA256) of the request using the Session Key generated as below.
        • Session Key = base64_encode[HMAC-SHA256(key, data)] where key is the user's password and data is the session secret obtained from clientLogin response.
      • Please refer to Signing Requests for information about how to generate signature.

Response Format

Upon successful validation of the request, user will be redirected to the destination Url. If no destination Url is provided, HTTP status codes will be returned as follows:

200 - Success
Establishes web authentication session for the user.
400 - Failure
Due to invalid/expired token or invalid sig_sha256 value.