TokenGenerator Class - masonbesmer/Abet-Course-Assessment-Tool-Backend GitHub Wiki

TokenGenerator Class

Home

Functionality

This is the class for generating tokens as opposed to the Interface.

The primary function of this is to generate a token from a string EUID and A list of roles. The function gets the identity and role from the security token handler and adds it to the subject as used in the token descriptor. Next, it Builds the token and passes it to the security token as a completed descriptor. It then returns the written token from that same token.

Variables & Functions

Variables

private: 
 string secretApiKey;

Functions

Public:
 TokenGenerator(Configuration) - sets the security key from the configuration
 GenerateToken(EUID, Roles) - Takes the EUID and Roles to configure them into a completed security token then returns a string