generate bearer token with spn id code example

Example 1: what is bearer token

Authorization :
It's a process of granting or denying access to resources.
Mostly it happens after Authentatication.

Most of the projects I worked on use Bearer token
with JWT in Authorizaiton header.
I have endpoint that I can use to generate this token
and pass it to the each requests in my test.

- Bearer Token
       (We can get it by requesting to certain endpoint)
       Most known jwt(json web token)

Example 2: generate bearer token

HMACSHA256(
  base64UrlEncode(header) + "." +
  base64UrlEncode(payload),
  
) secret base64 encoded

Tags:

Misc Example