/Account/AuthenticateJwt

Allows a service to authenticate a JWT token issued by the broker. This resource does not require authenticated access. Any service that receives a JWT token issued by the broker can request the broker to validate the token, and to return parsed information available in the token.

JSON

Request
{
	"token":Optional(Str(PToken))
}
Response (if successful, i.e. token is valid)
{
	"header":Required(Str(PHeader)),
	"payload":Required(Str(PPayload)),
	"signature":Required(Str(PSignature)),
	"algorithm":Required(Str(PAlgorithm)),
	"claims":Required(PClaims),
	"type":Optional(Str(PType)),
	"issuer":Optional(Str(PIssuer)),
	"subject":Optional(Str(PSubject)),
	"id":Optional(Str(PId)),
	"audience":Optional(Str(PAudience[])),
	"expiration":Optional(DateTime(PExpiration)),
	"notBefore":Optional(DateTime(PNotBefore)),
	"issuedAt":Optional(DateTime(PIssuedAt))
}

XML

Request
<AuthenticateJwt xmlns="https://waher.se/Schema/BrokerAgent.xsd"
                 token=(Required(Str(PToken))) />
Response (if successful)
<ValidJwt xmlns="https://waher.se/Schema/BrokerAgent.xsd"
          header=(Required(Str(PJwt)))
          payload=(Required(Str(PPayload)))
          signature=(Required(Str(PSignature)))
          algorithm=(Required(Str(PAlgorithm)))
          type=(Optional(Str(PType)))
          issuer=(Optional(Str(PIssuer)))
          subject=(Optional(Str(PSubject)))
          id=(Optional(Str(PId)))
          expiration=(Optional(DateTime(PExpiration)))
          notBefore=(Optional(DateTime(PNotBefore)))
          issuedAt=(Optional(DateTime(PIssuedAt)))>
	<[Required(PClaims)]>
	<[Optional(Str(PAudience[]))]>
<ValidJwt>

Input Parameters

Parameter Description
PToken JWT token to validate.

Response Parameters

Parameter Description
PJwt A token representing the login to the account. This token is seant as a Bearer token in requests requiring authentication.
PPayload Payload portion of the token.
PSignature Signature portion of the token
PAlgorithm Algorithm used to sign token.
PType Type of token.
PIssuer Issuer of token.
PSubject Subject of the token.
PId Identifier of token.
PAudience Audience for token.
PExpiration When token expires.
PNotBefore If token has a not-before timestamp.
PIssuedAt When token was created.

Javascript Library

Use the following asynchronous method in the Javascript Library, to call this resource.

var Response = await AgentAPI.Account.AuthenticateJwt(Token);
Test


Request Payload:

   

Response Payload: