NST

NST (JWT) token for nopStation

 

We have used JWT as NST in our api/app. JSON Web Token (JWT) is a JSON-based open standard for creating access tokens that assert some number of claims. 

For example, a server could generate a token that has the claim "logged in as admin" and provide that to a client. The client could then use that token to prove that it is logged in as admin. The tokens are signed by one party's private key (usually the server's), so that both parties (the other already being, by some suitable and trustworthy means, in possession of the corresponding public key) are able to verify that the token is legitimate. 

The tokens are designed to be compact, URL-safe and usable especially in web browser single sign-on (SSO) context. 

JWT claims can be typically used to pass identity of authenticated users between an identity provider and a service provider, or any other type of claims as required by business processes.

 

JWT relies on other JSON-based standards: JWS (JSON Web Signature) and JWE (JSON Web Encryption)

JWTs generally have three parts: a header, a payload, and a signature.

 

Use

In authentication, when the user successfully logs in using their credentials, a JSON Web Token will be returned and must be saved locally. This is a stateless authentication mechanism as the user state is never saved in server memory.

Implementations

To set/change NST_KEY & NST_SECRET value, go to this url of your domain: https://yourDomain/MobileWebApiConfiguration/NopStationSecrateToken 

You have to set the same  NST_KEY & NST_SECRET on iOS and Android source code to establish successful communication.

 

iOS

There is a swift file in source code “APIManagerClient.swift”. There are two variables in it.
  1. var NST_KEY_Value                   = "****************"

  2. var NST_SECRET_Value             = "*****"

***Developer has to change these two values by copy-pasting according to server value(NST_KEY and NST_SECRET).

 

 Android

 There is a kotlin file in source code  “SplashScreenActivity.kt”. There are two variables in it. 

   1.private val NST_KEY            =  "****************"

   2.private val NST_SECRET      = "*****" 

 

***Developer has to change these two values by copy-pasting according to server value(NST_KEY and NST_SECRET).